CVE-2021-23495: Open redirect in karma
5.4
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.47481%
CWE
Published
2/26/2022
Updated
2/3/2023
KEV Status
No
Technology
JavaScript
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
karma | npm | < 6.3.16 | 6.3.16 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from insufficient validation of the return_url parameter. The pre-patch code in client/karma.js and static/karma.js only checked if return_url started with http:// or https:// via a regex (/^https?:///). This allowed attackers to specify any external domain in return_url (e.g., http://attacker.com), resulting in an open redirect. The patch replaced this check with configurable regex patterns (allowedReturnUrlPatterns), demonstrating that the original validation was inadequate. The functions handling this logic in both files are directly responsible for the insecure redirect.