Skip to content

fix: add a missing regular expression anchor#4247

Merged
Laure-di merged 2 commits intomasterfrom
alert-autofix-29
Nov 4, 2024
Merged

fix: add a missing regular expression anchor#4247
Laure-di merged 2 commits intomasterfrom
alert-autofix-29

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
@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