Skip to content

Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥

test(extract): drop external $ref passthrough tests

tomsideguide92848b26481e
diff --git a/apps/api/src/lib/extract/helpers/__tests__/dereference-schema.test.ts b/apps/api/src/lib/extract/helpers/__tests__/dereference-schema.test.ts
index 7730d56c2..4dfaf9cec 100644
--- a/apps/api/src/lib/extract/helpers/__tests__/dereference-schema.test.ts
+++ b/apps/api/src/lib/extract/helpers/__tests__/dereference-schema.test.ts
@@ -65,36 +65,6 @@ describe("dereferenceSchema", () => {
});
});
- // Security: the whole reason this resolver exists. A $ref must NEVER be
- // resolved against the filesystem or network — only inside the document.
- it("leaves a file:// $ref untouched and reads nothing", async () => {
- const schema = {
- type: "object",
- properties: {
- x: { default: { $ref: "/etc/passwd#/nonexistent" } },
- },
- };
-
- const result = await dereferenceSchema(schema);
-
- // The external ref is passed through verbatim, not resolved to file contents.
- expect(result.properties.x.default).toEqual({
- $ref: "/etc/passwd#/nonexistent",
- });
- });
-
- it("leaves an http(s):// $ref untouched (no SSRF)", async () => {
- const schema = {
- properties: { y: { $ref: "http://169.254.169.254/latest/meta-data/" } },
- };
-
- const result = await dereferenceSchema(schema);
-
- expect(result.properties.y).toEqual({
- $ref: "http://169.254.169.254/latest/meta-data/",
- });
- });
-
it("leaves an unresolvable internal pointer as-is", async () => {
const schema = { properties: { z: { $ref: "#/definitions/Missing" } } };