CVE-2018-3739
Description
https-proxy-agent before 2.2.0 unsafely passes user-controlled input to the Buffer constructor, enabling denial of service and memory disclosure via crafted auth data.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
https-proxy-agent before 2.2.0 unsafely passes user-controlled input to the Buffer constructor, enabling denial of service and memory disclosure via crafted auth data.
Vulnerability
The https-proxy-agent npm package (versions before 2.2.0) passes the user-supplied auth option directly to the new Buffer() constructor without sanitization [2]. The vulnerable code is in index.js at line 207, where Buffer(proxy.auth) is converted to base64 for the Proxy-Authorization header [4]. Because new Buffer() with a numeric or object argument can lead to uninitialized memory or an abnormal process termination, an attacker who can control the auth parameter (e.g., via JSON input) triggers a denial of service or memory disclosure [3].
Exploitation
An attacker needs the ability to supply a crafted value to the auth option of an https-proxy-agent instance. In scenarios where the agent receives user-supplied JSON (e.g., from a web API that proxies requests), the attacker can set auth to a number or an array, bypassing any string-only expectations. No authentication or special network position is required beyond the ability to influence the input used to create the agent. The exploit does not require user interaction — it occurs when the proxy-agent processes the malicious configuration.
Impact
Successful exploitation results in a denial of service (DoS) due to the process crashing, and in cases where the auth value is a number, an uninitialized memory leak may occur, potentially exposing sensitive data from the heap to subsequent operations [1]. The vulnerability does not provide remote code execution or privilege escalation, but it compromises availability and confidentiality.
Mitigation
The vulnerability is fixed in https-proxy-agent version 2.2.0, released on July 27, 2018 [3]. The fix replaces the deprecated new Buffer() call with Buffer.from() [4], which validates the input and throws a clear error if the argument is not a string. Users should upgrade to >=2.2.0. There is no known KEV listing. No other workarounds were published in the available references.
AI Insight generated on May 22, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
https-proxy-agentnpm | < 2.2.0 | 2.2.0 |
Affected products
8- osv-coords7 versionspkg:apk/chainguard/jitsucom-jitsupkg:apk/chainguard/jitsucom-jitsu-consolepkg:apk/chainguard/jitsucom-jitsu-rotorpkg:apk/wolfi/jitsucom-jitsupkg:apk/wolfi/jitsucom-jitsu-consolepkg:apk/wolfi/jitsucom-jitsu-rotorpkg:npm/https-proxy-agent
< 0+ 6 more
- (no CPE)range: < 0
- (no CPE)range: < 0
- (no CPE)range: < 0
- (no CPE)range: < 0
- (no CPE)range: < 0
- (no CPE)range: < 0
- (no CPE)range: < 2.2.0
- HackerOne/https-proxy-agent node modulev5Range: Versions before 2.1.1
Patches
11c24219df875Use `Buffer.from()`
1 file changed · +1 −1
index.js+1 −1 modified@@ -204,7 +204,7 @@ HttpsProxyAgent.prototype.callback = function connect(req, opts, fn) { var headers = Object.assign({}, proxy.headers); if (proxy.auth) { headers['Proxy-Authorization'] = - 'Basic ' + new Buffer(proxy.auth).toString('base64'); + 'Basic ' + Buffer.from(proxy.auth).toString('base64'); } // the Host header should only include the port
Vulnerability mechanics
Generated on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
5- github.com/advisories/GHSA-8g7p-74h8-hg48ghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2018-3736ghsaADVISORY
- github.com/TooTallNate/node-https-proxy-agent/commit/1c24219df87524e6ed973127e81f30801d658f07ghsaWEB
- hackerone.com/reports/319532ghsax_refsource_MISCWEB
- www.npmjs.com/advisories/593ghsaWEB
News mentions
0No linked articles in our index yet.