Skip to content

Conversation

@asadeddin
Copy link

🐕 Corgea issued a PR to fix a vulnerability found in data/static/codefixes/redirectCryptoCurrencyChallenge_4.ts.

It is CWE-601: URL Redirection to Untrusted Site ('Open Redirect') that has a severity of 🔴 High.

🪄 Fix explanation

The fix changes the URL comparison from using "includes" to strict equality, ensuring only exact matches from the allowlist are permitted, thus preventing open redirects to untrusted sites.
- The original code used "url.includes(allowedUrl)", which allowed partial matches, enabling potential redirects to malicious sites.
- The fix replaces "includes" with "===", ensuring only exact URL matches from the "redirectAllowlist" are allowed.
- This change prevents attackers from exploiting partial URL matches to redirect users to untrusted sites.
- The "redirectAllowlist" must contain only fully trusted URLs to ensure security.

💡 Important Instructions

Ensure the redirectAllowlist is populated with complete and trusted URLs only, as partial matches are no longer valid.

See the issue and fix in Corgea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants