npm / ajv / 8.20.0

ajv 8.20.0

Source
https://github.com/ajv-validator/ajv
Artifact scanned
ajv-8.20.0.tgz (npm tarball · 212.5 KB · SHA-256 b2f0b3a893bb…)
Compared with
ajv-8.18.0.tgz (0 signals introduced since)
Files
321 scanned, 145 skipped (binary, oversized, or unrecognised)
Signals
0 critical · 0 warn · 7 info
Scan time
7.0 s
LLM review
Reviewed by claude-haiku-5-5 (Anthropic): 6 of 6 warn and critical signals; 6 demoted to info.
Disclude version
4.3.0
Scanned (UTC)
2026-10-23 13:48

Signals

Ordered by severity, then signals introduced in this release. Hidden characters are shown as ⟨U+…⟩.

  1. info long-line README.md:25:1

    line length 695 characters (raw pass, confidence 0.50)

    [<img src="https://ajv.js.org/img/retool.svg" width="22.5%" alt="Retool">]https://retool.com/?utm_source=sponsor&utm_campaign=ajv<img src="https://ajv.js.org/img/gap.svg" width="3%">[<img src="https://ajv.js.org/img/tidelift.svg" width="22.5%" alt="Tidelift">](https://tidelift.com/subscription/pkg/npm-ajv?utm_source=
  2. info critical → info by review dynamic-execution dist/compile/index.js:89:30

    `Function(...)` called with a non-literal body (ast pass, confidence 0.90)

            // console.log("\n\n\n *** \n", sourceCode)
            const makeValidate = new Function(`${names_1.default.self}`, `${names_1.default.scope}`, sourceCode);
            const validate = makeValidate(this, this.scope.get());
            this.scope.value(validateName, { ref: validate });
    likely benign LLM, confidence 0.85 Schema compiler in ajv that turns generated validation source into a callable validate function via new Function.
    Reasoning

    This is the standard ajv schema compiler, which builds a validator by generating JavaScript source from a JSON schema and evaluating it with new Function. The body is generated code rather than attacker-supplied input, and the same pattern appears in the matching TypeScript source. It is a documented design choice of the library, so the flag is a true pattern match with a legitimate purpose.

  3. info critical → info by review dynamic-execution dist/compile/jtd/parse.js:50:27

    `Function(...)` called with a non-literal body (ast pass, confidence 0.90)

            sourceCode = `${gen.scopeRefs(names_1.default.scope)}return ${parseFuncCode}`;
            const makeParse = new Function(`${names_1.default.scope}`, sourceCode);
            const parse = makeParse(this.scope.get());
            this.scope.value(parseName, { ref: parse });
    likely benign LLM, confidence 0.85 JTD parser builder that evaluates generated parse code with new Function.
    Reasoning

    The JTD parser generator assembles parser source from schema-derived code and evaluates it with new Function. This is ajv's codegen for JSON Type Definition parsing, not a dropper or hidden payload. Nothing in the snippet fetches or decodes external data.

  4. info critical → info by review dynamic-execution dist/compile/jtd/serialize.js:50:31

    `Function(...)` called with a non-literal body (ast pass, confidence 0.90)

            sourceCode = `${gen.scopeRefs(names_1.default.scope)}return ${serializeFuncCode}`;
            const makeSerialize = new Function(`${names_1.default.scope}`, sourceCode);
            const serialize = makeSerialize(this.scope.get());
            this.scope.value(serializeName, { ref: serialize });
    likely benign LLM, confidence 0.85 JTD serializer builder that evaluates generated serialization code with new Function.
    Reasoning

    This is the JTD serializer counterpart of the parser codegen. It composes source from the schema and evaluates it with new Function, matching ajv's documented code generation approach. No obfuscation or network or process activity appears.

  5. info critical → info by review dynamic-execution lib/compile/index.ts:171:26

    `Function(...)` called with a non-literal body (ast pass, confidence 0.90)

        // console.log("\n\n\n *** \n", sourceCode)
        const makeValidate = new Function(`${N.self}`, `${N.scope}`, sourceCode)
        const validate: AnyValidateFunction = makeValidate(this, this.scope.get())
        this.scope.value(validateName, {ref: validate})
    likely benign LLM, confidence 0.85 TypeScript schema compiler in ajv that evaluates generated validator source with new Function.
    Reasoning

    The TypeScript source of the ajv validator compiler, identical in logic to the compiled dist file. The Function call evaluates code generated from the schema, which is the library's intended behavior. The snippet shows no encoding, obfuscation, or external input being executed.

  6. info critical → info by review dynamic-execution lib/compile/jtd/parse.ts:69:23

    `Function(...)` called with a non-literal body (ast pass, confidence 0.90)

        sourceCode = `${gen.scopeRefs(N.scope)}return ${parseFuncCode}`
        const makeParse = new Function(`${N.scope}`, sourceCode)
        const parse: (json: string) => unknown = makeParse(this.scope.get())
        this.scope.value(parseName, {ref: parse})
    likely benign LLM, confidence 0.85 TypeScript JTD parser builder that evaluates generated parse code with new Function.
    Reasoning

    This is the TypeScript JTD parser generator. It builds parse source from the schema and evaluates it with new Function, a known ajv codegen technique. The code is typed and readable with no sign of hidden or malicious behavior.

  7. info critical → info by review dynamic-execution lib/compile/jtd/serialize.ts:65:27

    `Function(...)` called with a non-literal body (ast pass, confidence 0.90)

        sourceCode = `${gen.scopeRefs(N.scope)}return ${serializeFuncCode}`
        const makeSerialize = new Function(`${N.scope}`, sourceCode)
        const serialize: (data: unknown) => string = makeSerialize(this.scope.get())
        this.scope.value(serializeName, {ref: serialize})
    likely benign LLM, confidence 0.85 TypeScript JTD serializer builder that evaluates generated serialization code with new Function.
    Reasoning

    This is the TypeScript JTD serializer generator, using the same schema-driven codegen and new Function evaluation as the rest of ajv. The snippet is readable and consistent with a validation library, and it shows no suspicious behavior.

Reproduce This Scan

Run disclude locally to verify. These commands scan the published file; the "new in this release" marks come from comparing it with the previous release's file, which they don't repeat. Add --format sarif for SARIF output. Add --llm (with an API key in the environment) to include the LLM review.

cargo install disclude --version 4.3.0
curl -fsSL -o ajv-8.20.0.tgz https://registry.npmjs.org/ajv/-/ajv-8.20.0.tgz
printf '%s  %s\n' b2f0b3a893bbb8cc5efb6814f08b1499e19e31d5dd73683f5893382f48f6e7b3 ajv-8.20.0.tgz | shasum -a 256 -c -
mkdir pkg && tar -xzf ajv-8.20.0.tgz -C pkg --strip-components 1
disclude scan --untrusted --severity info pkg