Skip to content
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

fix: add a missing regular expression anchor #4247

Merged
merged 2 commits into from
Nov 4, 2024
Merged

Conversation

remyleone
Copy link
Member

Fixes https://github.com/scaleway/scaleway-cli/security/code-scanning/29

To fix the problem, we need to add anchors to the regular expression to ensure it matches the expected part of the URL. Specifically, we should add the ^ anchor at the beginning of the regex to ensure it matches the start of the URL path. This will prevent the regex from matching unintended parts of the URL.

  • Add the ^ anchor to the beginning of the regex on line 23.
  • Ensure that the regex still performs the intended replacement without changing existing functionality.

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>
@remyleone remyleone marked this pull request as ready for review October 31, 2024 08:51
@remyleone remyleone changed the title Fix code scanning alert no. 29: Missing regular expression anchor fix: add a missing regular expression anchor Oct 31, 2024
@Laure-di Laure-di enabled auto-merge November 4, 2024 07:25
@Laure-di Laure-di added this pull request to the merge queue Nov 4, 2024
Merged via the queue into master with commit f4fb6a6 Nov 4, 2024
14 checks passed
@Laure-di Laure-di deleted the alert-autofix-29 branch November 4, 2024 07:35
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