Repository navigation
Conversation
Automated security fix generated by OrbisAI Security Signed-off-by: anupamme <mediratta@gmail.com>
|
Thanks for the report — the concern is well-intentioned, but this change is not needed. The codebase is already protected against CWE-1321 (prototype pollution) through two independent layers, verified against the actual runtime. Why the fix is redundantLayer 1 —
|
|
Thanks for taking the time to verify this. I agree that with the current Lodash version and the JSON normalisation, I haven’t demonstrated a working prototype-pollution exploit against the current implementation. If you're open to it, I can revise the PR accordingly rather than overstate the CWE-1321 finding. My intent with the guard was to make the merge boundary explicitly reject prototype-sensitive keys instead of relying entirely on Lodash’s current protections. I’ll add proper regression coverage using JSON-derived proto and |
The mergeAllOfSchemaProperties function uses lodash's mergeWith to merge OpenAPI schema objects without validating property names. An attacker who can supply a malicious OpenAPI document with 'proto', 'constructor', or 'prototype' property names can pollute Object.prototype, affecting all JavaScript objects in the application runtime. The affected code is
packages/ruleset/src/utils/merge-allof-schema-properties.js:1, and this change addresses it.Reference: CWE-1321
What changed
packages/ruleset/src/utils/merge-allof-schema-properties.jsVerification
No automated check could be run against this repository, so this change is unverified beyond review. Please treat it as a suggestion.
Regression test
The security boundary is maintained under adversarial input
Test