Skip to content

Potential fix for code scanning alert no. 88: Log injection #250

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

habib-deriv
Copy link
Contributor

Potential fix for https://github.com/deriv-com/deriv-api-docs/security/code-scanning/88

To fix the issue, we need to sanitize the data.proposal.payout value before logging it. Since the value is expected to be numeric, we can validate that it is indeed a number and convert it to a safe format. If the value is not numeric, we can log a default value or an error message instead. This ensures that malicious input cannot manipulate the logs.

The fix involves:

  1. Adding a check to ensure data.proposal.payout is a valid number.
  2. Sanitizing the value by converting it to a number using Number() and logging it safely.
  3. If the value is not numeric, logging a default value (e.g., 0) or an error message.

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>
Copy link

vercel bot commented Jun 29, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
deriv-api-docs ✅ Ready (Inspect) Visit Preview Jun 29, 2025 5:02pm

Copy link

Dependency Review

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

OpenSSF Scorecard

PackageVersionScoreDetails

Scanned Manifest Files

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.

1 participant