Conversation
PM- 228 Fix system information leak
Challenges updates
…required PM-684 - make job description a required field for Taas Projects
…nto update-workload-field
PM-683 - update workload field
PM-686 - NDA & work groups for projects
…update PM-683 - send jobid on update for taas projects
…fixes PM-803 wm regression fixes
…management PM-690 - assets library management
| /** | ||
| * regex for url validation | ||
| */ | ||
| const urlRegex = /((https?):\/\/)?(www.)?[a-z0-9]+(\.[a-z]{2,}){1,3}(#?\/?(?:[a-zA-Z0-9#]+))*\/?(\?[a-zA-Z0-9-_]+=[a-zA-Z0-9-%]+&?)?$/ |
Check failure
Code scanning / CodeQL
Inefficient regular expression High
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 12 months ago
To fix the problem, we need to modify the regular expression to remove the ambiguity that causes exponential backtracking. Specifically, we should avoid using ambiguous patterns like [a-zA-Z0-9#]+ and replace them with more precise patterns that do not allow multiple ways to match the same string.
The best way to fix this without changing existing functionality is to replace the problematic part of the regular expression with a more specific pattern. In this case, we can replace [a-zA-Z0-9#]+ with (?:[a-zA-Z0-9]+|#+) to ensure that the pattern matches either a sequence of alphanumeric characters or a sequence of # characters, but not an ambiguous mix of both.
| @@ -60,3 +60,3 @@ | ||
| */ | ||
| const urlRegex = /((https?):\/\/)?(www.)?[a-z0-9]+(\.[a-z]{2,}){1,3}(#?\/?(?:[a-zA-Z0-9#]+))*\/?(\?[a-zA-Z0-9-_]+=[a-zA-Z0-9-%]+&?)?$/ | ||
| const urlRegex = /((https?):\/\/)?(www.)?[a-z0-9]+(\.[a-z]{2,}){1,3}(#?\/?(?:[a-zA-Z0-9]+|#+))*\/?(\?[a-zA-Z0-9-_]+=[a-zA-Z0-9-%]+&?)?$/ | ||
|
|
This release contains code migration from connect to WM in order to deprecate Connect
https://topcoder.atlassian.net/browse/PM-413 - Deprecate Connect (5443)
https://topcoder.atlassian.net/browse/PM-803 - Regresion testing & fixes