# Risk map — colinhacks/zod

> Canonical page: https://codevetter.com/unpack/zod/risk-map

# Risk map — colinhacks/zod

Scanned commit 10dda3a3a4bc76ed0bf83e994de194587e489ef8 (2026-09-21). Generated by codevetter codevetter 1.12.0 on 2026-09-22.

The core library has no authentication, database, or arbitrary filesystem surface, but it processes untrusted values and generates executable validation functions, so correctness and denial-of-service behavior are security-relevant. The code contains explicit mitigations for prototype pollution, cycles, ReDoS-prone formats, CSP restrictions, and duplicated callback execution. The documentation and automation layers introduce the repository's network, filesystem, token, and privileged CI boundaries. The largest maintenance risk is semantic drift among interpreted parsing, object JIT, AOT compilation, JSON Schema generation, classic, and mini surfaces.
- AOT compilation uses the `Function` constructor and is incompatible with strict no-eval CSPs; global mode honors `config({jitless:true})`, while an explicit `z.compile()` call is treated as deliberate opt-in. — [packages/zod/src/v4/core/compile.ts#L237-284](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/packages/zod/src/v4/core/compile.ts#L237-L284) [packages/zod/src/compile.ts#L23-44](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/packages/zod/src/compile.ts#L23-L44) [packages/zod/README.md#L128-139](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/packages/zod/README.md#L128-L139)
- Generated code receives user callbacks as hoisted constants rather than interpolating their source, but those callbacks can throw or return promises and force the compiler to weaken its definitive-rejection guarantee or refuse compilation. — [packages/zod/src/v4/core/compile.ts#L287-300](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/packages/zod/src/v4/core/compile.ts#L287-L300) [packages/zod/src/v4/core/compile.ts#L2177-2237](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/packages/zod/src/v4/core/compile.ts#L2177-L2237) [wiki/compile.md#L18-30](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/wiki/compile.md#L18-L30)
- On invalid compiled inputs, refinements and transforms may execute twice—once in the fast path and once in interpreter fallback—so user callbacks should not rely on exactly-once side effects. — [packages/zod/README.md#L134-139](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/packages/zod/README.md#L134-L139) [wiki/compile.md#L26-30](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/wiki/compile.md#L26-L30)
- `z.jwt()` is a structural validator only: it splits three segments, decodes and parses the header, checks `typ` and `alg`, but performs no signature, issuer, audience, expiration, or claims verification. — [packages/zod/src/v4/core/schemas.ts#L1218-1259](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/packages/zod/src/v4/core/schemas.ts#L1218-L1259)
- Prototype-pollution defenses are load-bearing: object parsing strips undeclared `__proto__`, compiled records recheck transformed keys, and `assignProp` uses `Object.defineProperty` so hostile property names become own data properties. — [packages/zod/src/v4/core/schemas.ts#L2115-2125](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/packages/zod/src/v4/core/schemas.ts#L2115-L2125) [packages/zod/src/v4/core/compile.ts#L2015-2034](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/packages/zod/src/v4/core/compile.ts#L2015-L2034) [packages/zod/src/v4/core/util.ts#L367-418](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/packages/zod/src/v4/core/util.ts#L367-L418)
- Recursive object graphs are supported only through the memoized runtime path; cycles through transforms throw `$ZodCyclicError`, and AOT compilation refuses recursive schema subtrees because generated functions do not receive the parse context. — [packages/zod/src/v4/core/memoizer.ts#L5-9](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/packages/zod/src/v4/core/memoizer.ts#L5-L9) [packages/zod/src/v4/core/memoizer.ts#L226-237](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/packages/zod/src/v4/core/memoizer.ts#L226-L237) [packages/zod/src/v4/core/compile.ts#L151-155](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/packages/zod/src/v4/core/compile.ts#L151-L155) [packages/zod/src/v4/core/compile.ts#L237-245](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/packages/zod/src/v4/core/compile.ts#L237-L245)
- `fromJSONSchema` rejects external references and normalizes input with a JSON round-trip; this bounds traversal to JSON data but also means cyclic JavaScript objects, getters, proxies, class identity, and non-JSON values cannot be preserved. — [packages/zod/src/v4/classic/from-json-schema.ts#L127-155](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/packages/zod/src/v4/classic/from-json-schema.ts#L127-L155) [packages/zod/src/v4/classic/from-json-schema.ts#L917-929](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/packages/zod/src/v4/classic/from-json-schema.ts#L917-L929)
- The docs build sends a server-side `GITHUB_TOKEN` to GitHub GraphQL to obtain ecosystem star counts, retries failures, and intentionally fails production builds if the integration cannot supply data. — [packages/docs/loaders/stars.ts#L1-34](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/packages/docs/loaders/stars.ts#L1-L34) [packages/docs/loaders/stars.ts#L36-84](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/packages/docs/loaders/stars.ts#L36-L84) [CONTRIBUTING.md#L42-61](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/CONTRIBUTING.md#L42-L61)
- Inkeep search and chat execute in client components using `NEXT_PUBLIC_INKEEP_KEY`; the variable is intentionally browser-visible and must not be treated as a private server credential. — [packages/docs/components/inkeep-bubble.tsx#L1-18](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/packages/docs/components/inkeep-bubble.tsx#L1-L18) [packages/docs/components/inkeep-search.tsx#L1-20](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/packages/docs/components/inkeep-search.tsx#L1-L20)
- The Pullfrog workflow combines repository and issue write permissions with a broad set of model-provider secrets, making the third-party agent action a high-blast-radius CI trust boundary. — [.github/workflows/pullfrog.yml#L14-20](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/.github/workflows/pullfrog.yml#L14-L20) [.github/workflows/pullfrog.yml#L22-45](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/.github/workflows/pullfrog.yml#L22-L45)
- Publishing has write access to repository contents and OIDC, but is constrained to a manually dispatched npm environment with required approval, full prepublish checks, package availability polling, and provenance-enabled publishing. — [.github/workflows/release.yml#L3-7](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/.github/workflows/release.yml#L3-L7) [.github/workflows/release.yml#L67-78](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/.github/workflows/release.yml#L67-L78) [.github/workflows/release.yml#L104-129](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/.github/workflows/release.yml#L104-L129)
- Shared semantic changes have unusually high blast radius because interpreted containers, optionality rules, object JIT, AOT code generation, JSON Schema processors, classic, and mini must agree on key presence, output construction, and failure behavior. (inferred) — [wiki/optionality.md#L78-117](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/wiki/optionality.md#L78-L117) [packages/zod/src/v4/core/schemas.ts#L1973-2014](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/packages/zod/src/v4/core/schemas.ts#L1973-L2014) [packages/zod/src/v4/core/compile.ts#L115-137](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/packages/zod/src/v4/core/compile.ts#L115-L137) [packages/zod/src/v4/core/json-schema-processors.ts#L832-874](https://github.com/colinhacks/zod/blob/10dda3a3a4bc76ed0bf83e994de194587e489ef8/packages/zod/src/v4/core/json-schema-processors.ts#L832-L874)

Every claim links to its cited files at the pinned commit. Citations identify source evidence; they do not establish runtime correctness. Independent CodeVetter scan — not reviewed by upstream maintainers.

## Public product links

- [CodeVetter](https://codevetter.com/)
- [Download](https://codevetter.com/download)
- [Documentation](https://codevetter.com/docs/)
- [Source](https://github.com/Codevetter/codevetter)
