diff @7.0.0
A JavaScript text diff implementation.
Maintainers
Keywords
Dev Dependencies (36)
| Package | Constraint | Registry Status |
|---|---|---|
| chai | ^4.2.0 | auto_approved |
| grunt | ^1.6.1 | auto_approved |
| karma | ^6.4.3 | auto_approved |
| mocha | ^7.0.0 | auto_approved |
| eslint | ^5.12.0 | auto_approved |
| rollup | ^4.13.0 | auto_approved |
| semver | ^7.6.0 | auto_approved |
| webpack | ^5.90.3 | auto_approved |
| istanbul | github:kpdecker/istanbul | No greenflagged match |
| grunt-cli | ^1.4.3 | auto_approved |
| @babel/cli | ^7.24.1 | auto_approved |
| grunt-exec | ^3.0.0 | auto_approved |
| @babel/core | ^7.24.1 | auto_approved |
| grunt-babel | ^8.0.0 | Not imported |
| grunt-karma | ^4.0.2 | Not imported |
| karma-mocha | ^2.0.1 | auto_approved |
| babel-eslint | ^10.0.1 | auto_approved |
| babel-loader | ^9.1.3 | auto_approved |
| grunt-eslint | ^24.3.0 | auto_approved |
| grunt-webpack | ^6.0.0 | Not imported |
| karma-webpack | ^5.0.1 | auto_approved |
| @colors/colors | ^1.6.0 | auto_approved |
| @babel/register | ^7.23.7 | auto_approved |
| grunt-mocha-test | ^0.13.3 | Not imported |
| @babel/preset-env | ^7.24.1 | auto_approved |
| grunt-contrib-copy | ^1.0.0 | auto_approved |
| webpack-dev-server | ^5.0.3 | auto_approved |
| grunt-contrib-clean | ^2.0.1 | auto_approved |
| grunt-contrib-watch | ^1.1.0 | auto_approved |
| rollup-plugin-babel | ^4.2.0 | auto_approved |
| grunt-contrib-uglify | ^5.2.2 | auto_approved |
| grunt-mocha-istanbul | ^5.0.2 | Not imported |
| karma-mocha-reporter | ^2.2.5 | auto_approved |
| karma-chrome-launcher | ^3.2.0 | auto_approved |
| karma-sourcemap-loader | ^0.4.0 | auto_approved |
| @babel/plugin-transform-modules-commonjs | ^7.24.1 | auto_approved |
Changes from v5.2.0
No metadata changes detected.
File 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-73rr-hh4g-fpgx |
osv | reject | AI | AI (osv): DoS vulnerability in parsePatch/applyPatch; affects >=5.0.0 <5.2.2; fix available in 5.2.2. Reject generalizes to all affected versions. |
SAST Findings (3)
[Always reject] ### Impact Attempting to parse a patch whose filename headers contain the line break characters `\r`, `\u2028`, or `\u2029` can cause the `parsePatch` method to enter an infinite loop. It then consumes memory without limit until the process crashes due to running out of memory. Applications are therefore likely to be vulnerable to a denial-of-service attack if they call `parsePatch` with a user-provided patch as input. A large payload is not needed to trigger the vulnerability, so size limits on user input do not provide any protection. Furthermore, some applications may be vulnerable even when calling `parsePatch` on a patch generated by the application itself if the user is nonetheless able to control the filename headers (e.g. by directly providing the filenames of the files to be diffed). The `applyPatch` method is similarly affected if (and only if) called with a string representation of a patch as an argument, since under the hood it parses that string using `parsePatch`. Other methods of the library are unaffected. Finally, a second and lesser bug - a ReDOS - also exhibits when those same line break characters are present in a patch's *patch* header (also known as its "leading garbage"). A maliciously-crafted patch header of length *n* can take `parsePatch` O(*n*³) time to parse. ### Patches All vulnerabilities described are fixed in v8.0.3. ### Workarounds If using a version of jsdiff earlier than v8.0.3, do not attempt to parse patches that contain any of these characters: `\r`, `\u2028`, or `\u2029`. ### References PR that fixed the bug: https://github.com/kpdecker/jsdiff/pull/649 ### CVE Notes Note that although the advisory describes two bugs, they each enable exactly the same attack vector (that an attacker who controls input to `parsePatch` can cause a DOS). Fixing one bug without fixing the other therefore does not fix the vulnerability and does not provide any security benefit. Therefore we assume that the bugs cannot possibly constitute Independently Fixable Vulnerabilities in the sense of CVE CNA rule 4.2.11, but rather that this advisory is properly construed under the rules as describing a single Vulnerability.
This version has no gitHead field linking it to a source commit, but previous versions did. This suggests the publish environment changed. Published by: explodingcabbage.
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).
Published to npm: