Ajv 6
Last reviewed Sep 6, 2026
Prompt Details
Prompt Composition
2prompts
- JavaScript ES2026102 lines · 3.1K tokens
- Ajv 653 lines · 2.3K tokens
Total155 lines · 5.4K tokens
CWE Coverage
- 15
- 20
- 79
- 89
- 95
- 117
- 208
- 209
- 323
- 338
- 346
- 347
- 352
- 362
- 400
- 459
- 471
- 494
- 502
- 602
- 636
- 674
- 770
- 807
- 829
- 838
- 862
- 916
- 918
- 922
- 943
- 1004
- 1173
- 1321
- 1333
Prompt Preview
Apply the JavaScript ES2026 baseline first. These rules cover the Ajv 6 legacy line, checked against 6.15.0, including its schema compiler, permissive defaults, built-in formats, data mutation, remote references, extensions, generated code, and error handling.
Version, runtime, and dialect boundary
- Take Ajv 6 fixes from the newest 6.x release. Ajv has shipped its 6.x security backports as new minor releases rather than as patches to older minors, so a tilde range, or a lockfile entry held on an older 6.x minor, never receives them. Many tools still pull in Ajv 6 transitively, so check every resolved copy with
npm ls ajvand raise old ones withnpm update ajv, or with anoverridesentry scoped to the packages that still need Ajv 6 so it doesn't also rewrite Ajv 8 copies elsewhere in the tree. - Treat Ajv 6 as a legacy compatibility dependency and maintain a tested migration plan to the current major line; do not add new Ajv 6 usage when Ajv 8 can satisfy the schema contract.
- Run Ajv only on a currently supported JavaScript runtime. Ajv 6.15.0 declares no
enginesconstraint and its tagged documentation only claims Node.js through 14.x, so package installation success is not proof of runtime support or security. - Select the schema dialect deliberately: use the default
schemaId: "$id"for draft-06/07, registerajv/lib/refs/json-schema-draft-06.jsonwithaddMetaSchemafor draft-06, and add the exact trusted meta-schema plusschemaId: "id"or"auto"only when draft-04 compatibility is required. Never let request data select the dialect or meta-schema.