GHSA-6w3j-5fw6-r9vr is a low-severity (CVSS 3.7) CWE-1321 vulnerability in joi. O3 Security confirms whether GHSA-6w3j-5fw6-r9vr is actually reachable in your code before you act, and blocks exploitation at runtime until you patch.
joi: Prototype pollution via a `__proto__` language key in custom messages
Exploitation Status
No confirmed exploitation observed yet
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for GHSA-6w3j-5fw6-r9vr.
Real-World Exposure
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.
joinpm@hapi/joinpmDescription
Impact
An application that passes attacker-controlled data into joi's custom message configuration (messages(), message(), prefs({ messages }), Joi.extend({ messages }) or rule({ message })) lets the attacker write properties onto Object.prototype, where every object in the process then inherits them. A key named __proto__ was treated as a language name, and the code reused the object it found at that key, which resolves to the prototype rather than to a new own property; a key named constructor did the same to the Object function's statics. A consuming application that gates on the mere presence of a property (if (user.isAdmin)) can be made to take the wrong branch for every object it inspects.
This is not reachable from data that joi validates. Custom messages are schema-construction configuration, normally written by the application developer. Exploitation therefore requires an application that feeds untrusted input straight into schema construction.
Patches
Upgrade to version 18.2.5 or 17.13.6.
Workarounds
Do not pass untrusted input into messages(), message(), prefs({ messages }), Joi.extend({ messages }) or rule({ message }). Or validate that they don't contain any __proto__ or constructor property.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦npm | joi | ≥ 17.2.0&&< 17.13.6 | 17.13.6 |
| 📦npm | @hapi/joi | ≥ 16.0.0 | No fix |
| 📦npm | joi | ≥ 18.0.0&&< 18.2.5 | 18.2.5 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for joi. O3's reachability analysis confirms whether the vulnerable code path is actually invoked in your application, so you act on real exposure instead of every transitive match.
Fix
Update joi to 17.13.6 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-6w3j-5fw6-r9vr is resolved across your whole dependency graph.
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.
How O3 protects you
O3 pinpoints whether GHSA-6w3j-5fw6-r9vr is reachable in your code and exactly where to fix it, then blocks exploitation in production at runtime until the patched version is deployed.
Tailored to GHSA-6w3j-5fw6-r9vr. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.
Frequently Asked Questions
Is GHSA-6w3j-5fw6-r9vr in your dependencies?
O3 detects GHSA-6w3j-5fw6-r9vr across npm dependencies and uses function-level reachability to confirm whether the vulnerable code path is actually reachable — not just present. No false positives.