Skip to content
This repository was archived by the owner on Aug 11, 2026. It is now read-only.

Potential fix for code scanning alert no. 83: Client-side URL redirect - #1133

Draft
farabi-deriv wants to merge 1 commit into
masterfrom
fix-codeql-83
Draft

Potential fix for code scanning alert no. 83: Client-side URL redirect#1133
farabi-deriv wants to merge 1 commit into
masterfrom
fix-codeql-83

Conversation

@farabi-deriv

Copy link
Copy Markdown
Contributor

Potential fix for https://github.com/deriv-com/smarttrader/security/code-scanning/83

To fix the issue, we need to ensure that the redirect_url is validated against a whitelist of trusted domains or paths before redirection. This can be achieved by maintaining a list of authorized URLs on the server or in the client code and checking the redirect_url against this list. If the redirect_url is not in the whitelist, the code should default to a safe URL.

Steps to fix:

  1. Introduce a whitelist of trusted URLs or domains in the client code.
  2. Validate the redirect_url against this whitelist before using it in window.location.replace.
  3. If the redirect_url is not in the whitelist, set it to a default safe URL.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails

Scanned Manifest Files

@github-actions

Copy link
Copy Markdown
Name Result
Build status Failed ❌
Action URL Visit Action

Check warning

Code scanning / CodeQL

Client-side URL redirect

Untrusted URL redirection depends on a [user-provided value](1). Untrusted URL redirection depends on a [user-provided value](2). Untrusted URL redirection depends on a [user-provided value](3).

Check warning

Code scanning / CodeQL

Client-side URL redirect

Untrusted URL redirection depends on a [user-provided value](1). Untrusted URL redirection depends on a [user-provided value](2). Untrusted URL redirection depends on a [user-provided value](3).
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants