Know every vulnerabilitybefore it knows you.
DevGuard continuously monitors your dependencies and alerts you when CVEs like this one affect your stack — with real-time threat intelligence built for developers.
GHSA-g956-2f74-rmv7
No affected components available
Summary
The hashi-vault-js library is vulnerable to path traversal and query string injection due to the lack of proper encoding of identifiers in path segments and query strings. This allows attackers to manipulate the request URL and potentially access unintended downstream endpoints or inject malicious parameters if untrusted input is passed to the library.
Details
There are zero calls to encodeURIComponent anywhere in Vault.js. Every identifier (e.g., name, username, group, role, version) provided to the library is concatenated straight into the HTTP URL without URI encoding.
Two vectors can be dynamically confirmed:
- Path Traversal: Passing
../../sys/sealas a secret name causes the HTTP client to normalize the path and send the request to/v1/sys/sealinstead of the intended Key-Value path. - Query Injection: Passing
1&list=trueas a version value injects an extra query parameter into the request payload.
Impact
In applications where Vault identifiers originate from untrusted user input, this allows an unauthenticated attacker to redirect requests to unintended Vault endpoints (including administrative paths under sys/) or otherwise alter the executed query, executing operations within the permissions of the Vault token used by the application.
Patches
This vulnerability has been addressed by wrapping path segments with encodeURIComponent() and safely formatting query strings instead of manual string concatenation. Users should upgrade to a version that includes this fix.
Workarounds
If you cannot immediately update the library, you can mitigate this issue by rigidly validating and sanitizing all user-supplied input before passing it into hashi-vault-js methods. Alternatively, manually encode inputs using encodeURIComponent() before supply them to the library's functions.
Acknowledgements
hashi-vault-js would like to thank Sebastián Alba Vives for reporting this vulnerability.
The vulnerability can be exploited over the network without needing physical access. It is easy for an attacker to exploit this vulnerability. An attacker does not need any special privileges or access rights. No user interaction is needed for the attacker to exploit this vulnerability.
Exploitation attempts have been detected. Elevated vigilance and prompt remediation are advised.
Probability that this vulnerability will be exploited in the wild within the next 30 days.
We did not find any exploit available. Neither in GitHub repositories nor in the Exploit-Database.
Browse More
Continuously monitor your dependencies and get alerted when vulnerabilities like this one affect your stack.
Checkout DevGuard