foundation-sites
foundation-sites copied to clipboard
fix: prevent ReDoS in URL regex pattern
trafficstars
Description
This PR updates the URL validation regex in foundation.abide.js to address the ReDoS vulnerability. I plugged the new regex into -- https://regexr.com/ -- and made sure it matched the same cases as the old one. I used this ReDoS checker -- https://devina.io/redos-checker -- to ensure that the new regex wasn't vulnerable.
- Closes #12180
Types of changes
- [ ] Documentation
- [X] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (anything that would change an existing functionality)
- [ ] Maintenance (refactor, code cleaning, development tools...)
Checklist
- [X] I have read and follow the CONTRIBUTING.md document.
- [X] The pull request title and template are correctly filled.
- [X] The pull request targets the right branch (
developordevelop-v...). - [X] My commits are correctly titled and contain all relevant information.
- [X] I have updated the documentation accordingly to my changes (if relevant).
- [X] I have added tests to cover my changes (if relevant).