Skip to content

Path traversal and query parameter injection

High
rod-anami-kyndryl published GHSA-g956-2f74-rmv7 Jun 9, 2026

Package

npm hashi-vault-js (npm)

Affected versions

<=0.5.1

Patched versions

0.5.2

Description

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:

  1. Path Traversal: Passing ../../sys/seal as a secret name causes the HTTP client to normalize the path and send the request to /v1/sys/seal instead of the intended Key-Value path.
  2. Query Injection: Passing 1&list=true as 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

We would like to thank Sebastián Alba Vives for reporting this vulnerability.

References

Severity

High

CVE ID

CVE-2026-55100

Weaknesses

Relative Path Traversal

The product uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize sequences such as .. that can resolve to a location that is outside of that directory. Learn more on MITRE.

Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')

The product constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component. Learn more on MITRE.

Credits