# npm content denial of service in HTTP header parser

Source: https://junglewise.ai/threats/npm-content-denial-of-service-in-http-header-parser-4db9bd00  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2020-09-03. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

Severity: info · Published 2020-09-03

The npm content package is a utility library that parses HTTP headers, particularly the Content-Encoding header. The Content-Encoding HTTP header parser has a vulnerability that causes the application to crash when it receives malformed header values. An attacker can send specially crafted HTTP requests with invalid headers to remotely shut down services that use this package.

Technologies: [npm (npm)](https://junglewise.ai/threats/technologies/npm). Vendors: [npm](https://junglewise.ai/threats/vendors/npm).

## Quick answers

**Is This vulnerability exploited in the wild?** No. Junglewise Threat Intelligence has no report of This vulnerability being exploited in the wild.

**How severe is This vulnerability?** Informational severity, published 3 September 2020.

**Which products and versions are affected?** npm (npm) 0 through 4.0.6 (all previous versions are affected; fixed in 4.1.1).

**Is there a fix for This vulnerability?** A patch was published on 2020-02-13: Fix released in v4.1.1 and package deprecated in favor of @hapi/content Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is This vulnerability attacked?** It is attacked over the network, in a software library.

**Am I affected?** Check whether you run npm (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## Technical details

The vulnerability is a denial of service flaw in the Content-Encoding HTTP header parser of the npm content package. When the parser encounters certain invalid values in the Content-Encoding header, it throws a system-level error rather than an application error. The hapi framework rethrows system errors instead of catching them as expected application errors, allowing the unhandled exception to propagate up the call stack. If the application lacks a global unhandled exception handler, this causes a process crash. The attack requires only network access and a single HTTP request with a malformed Content-Encoding header; no authentication is required. The package has been deprecated and replaced by @hapi/content, which contains the fix.

## Affected products

- npm content 0 through 4.0.6 (all previous versions are affected; fixed in 4.1.1)

## Timeline

- 2020-09-03: disclosed
- 2020-02-13: patched: Fix released in v4.1.1 and package deprecated in favor of @hapi/content

## References

- [https://github.com/hapijs/content/compare/v4.1.0...v4.1.1](https://github.com/hapijs/content/compare/v4.1.0...v4.1.1)
- [https://github.com/hapijs/subtext](https://github.com/hapijs/subtext)
- [https://www.npmjs.com/advisories/1478](https://www.npmjs.com/advisories/1478)

## Related threats

- [npm cli local privilege escalation via uncontrolled module search path](https://junglewise.ai/threats/cve-2026-0775-npm-cli-local-privilege-escalation-via-uncontrolled-module-search)
- [npm pack root-level ignore file bypass in workspaces](https://junglewise.ai/threats/cve-2022-29244-npm-pack-root-level-ignore-file-bypass-in-workspaces)
- [npm incorrect permission assignment in mkdir](https://junglewise.ai/threats/cve-2018-7408-npm-incorrect-permission-assignment-in-mkdir)
- [npm Arborist symlink following on case-insensitive filesystems](https://junglewise.ai/threats/cve-2021-39134-npm-arborist-symlink-following-on-case-insensitive-filesystems)
- [npm public path traversal via symlink navigation](https://junglewise.ai/threats/npm-public-path-traversal-via-symlink-navigation-dd9ade29)
