Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
📦
📦 npm
Not in CISA KEV
LOW severity

GHSA-m56h-5xx3-2jc2 jsii

LOW

GHSA-m56h-5xx3-2jc2 is a low-severity (CVSS 3.7) vulnerability in jsii. A fix is available for jsii — see the affected versions and patch details below.

Prototype pollution in jsii.configureCategories

Published
Dec 18, 2024
Updated
Jan 7, 2025
Affected
4 pkgs
Patched
4 / 4
Exploits
None indexed
Exploitation data as of Jan 7, 2025 · OSV.dev, FIRST.org (EPSS)

Real-World Exposure

4 pkgs affected

How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.

13other npm packages depend on this — each one inherits the vulnerability until it's patched upstream
jsiinpm
424Kdownloads / week

Description

Summary

jsii is a TypeScript to JavaScript compiler that also extracts an interface definition manifest to generate RPC stubs in various programming languages. jsii is typically used as a command-line tool, but it can also be loaded as a library. When loaded as a library into a larger application, prototype pollution may happen if untrusted user input is passed to the library. When used as a command line-tool, this pollution cannot occur.

Impact

You may be impacted if you have written an application that loads jsii as a library, and passes untrusted user input into the jsii.configureCategories() function. In that case, a user can craft input in such a way that, following the invocation, a field named "category" with a user-controlled value is added to the JavaScript Object prototype. This will cause every object in the program (both new and existing) to have a field named "category", even if it shouldn't.

This will not affect jsii itself, but it might affect the application you have loaded jsii into.

The function jsii.configureCategories() is used to configure the severity (error, warning, etc.) of various jsii diagnostics.

Impacted versions: <=5.7.2, <=5.6.3, <=5.5.14, <=5.4.45

Example:

const jsii = require('jsii');

// prints 'undefined'
console.log(JSON.stringify({}.category))

// calling 'configureCategories' with user input
jsii.configureCategories(JSON.parse('{"__proto__": "user-input"}'))

// from this point onwards, every single object literal in the program
// will contain the 'category' key, with user controlled value
console.log(JSON.stringify({}.category)) // prints 'user-input'


// this can affect the execution of the main program in case it also makes 
// use of an object key called 'category'. for example, if the main programs 
// happens to have code like this:

const x = {} // some object in the main program (not necessarily empty)

if (x.category) {
  // this block will always be executed, effectively 
  // changing the behavior of the main program.
  console.log('Do something')
} else {
  console.log('Do something else')
}

For more information about javascript prototype pollution, see [1].

Patches

A patch is included in versions 5.7.3, 5.6.4, 5.5.15, 5.4.46

Workarounds

Sanitize user input to configureCategories() by stripping the proto property if detected.

References

If you have any questions or comments about this advisory, we ask that you contact AWS/Amazon Security via our issue reporting page [2] or directly via email to [email protected]. Please do not create a public GitHub issue.

[1] https://learn.snyk.io/lesson/prototype-pollution/

[2] https://aws.amazon.com/security/issue-reporting

Credits

We would like to thank Tariq Hawis for collaborating on this issue through the coordinated vulnerability disclosure process.

Affected Packages

4 total 4 fixed
EcosystemPackageVulnerable rangeFix
📦npmjsii5.7.0&&< 5.7.35.7.3npm install jsii@5.7.3
📦npmjsii5.6.0&&< 5.6.45.6.4npm install jsii@5.6.4
📦npmjsii5.5.0&&< 5.5.155.5.15npm install jsii@5.5.15
📦npmjsii5.4.0&&< 5.4.465.4.46npm install jsii@5.4.46

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for jsii, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.

  2. Fix

    Update jsii to 5.7.3 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-m56h-5xx3-2jc2 is resolved across your whole dependency graph.

  3. Workarounds

    If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.

  4. How O3 protects you

    O3 Security's impact-aware SCA analyses which vulnerable code paths your application actually calls, so a match like GHSA-m56h-5xx3-2jc2 can be triaged on real exposure rather than presence alone.

Tailored to GHSA-m56h-5xx3-2jc2. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.

Frequently Asked Questions

## Summary `jsii` is a TypeScript to JavaScript compiler that also extracts an interface definition manifest to generate RPC stubs in various programming languages. jsii is typically used as a command-line tool, but it can also be loaded as a library. When loaded as a library into a larger application, prototype pollution may happen if untrusted user input is passed to the library. When used as a command line-tool, this pollution cannot occur. ## Impact You may be impacted if you have written an application that loads jsii as a library, and passes untrusted user input into the `jsii.configu
O3 Security · Impact-Aware SCA

Is GHSA-m56h-5xx3-2jc2 in your dependencies?

O3 Security finds GHSA-m56h-5xx3-2jc2 across npm dependencies, including transitive ones, and its impact-aware SCA ranks findings by whether your code actually calls the vulnerable path.

GHSA-m56h-5xx3-2jc2: jsii (Low 3.7) | O3 Security