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

Potential fix for code scanning alert no. 7: Missing regular expression anchor #26

Merged
merged 1 commit into from
Jan 25, 2025

Conversation

JasonLovesDoggo
Copy link
Owner

Potential fix for https://github.com/JasonLovesDoggo/caddy-defender/security/code-scanning/7

To fix the problem, we need to anchor the regular expression to ensure it matches the entire URL string from the beginning to the end. This can be done by adding ^ at the start and $ at the end of the regular expression. This ensures that the URL must start with https://download.microsoft.com/ and end with .json.

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>
Signed-off-by: Jason Cameron <jasoncameron.all@gmail.com>
@JasonLovesDoggo JasonLovesDoggo marked this pull request as ready for review January 25, 2025 19:18
@JasonLovesDoggo JasonLovesDoggo merged commit eae43e4 into main Jan 25, 2025
5 checks passed
@JasonLovesDoggo JasonLovesDoggo deleted the fix-regex-anchor branch January 25, 2025 19:20
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