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

[RELEASE] PM-413 - Deprecate Connect (5443) #1611

Merged
merged 46 commits into from
Feb 26, 2025
Merged

[RELEASE] PM-413 - Deprecate Connect (5443) #1611

merged 46 commits into from
Feb 26, 2025

Conversation

vas3a
Copy link
Collaborator

@vas3a vas3a commented Feb 25, 2025

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

himaniraghav3 and others added 30 commits January 13, 2025 23:40
PM- 228 Fix system information leak
…required

PM-684 - make job description a required field for Taas Projects
PM-686 - NDA & work groups for projects
…update

PM-683 - send jobid on update for taas projects
/**
* 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

This part of the regular expression may cause exponential backtracking on strings containing many repetitions of '#'.

Copilot Autofix AI 9 days 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.

Suggested changeset 1
src/util/validation.js

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/src/util/validation.js b/src/util/validation.js
--- a/src/util/validation.js
+++ b/src/util/validation.js
@@ -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-%]+&?)?$/
 
EOF
@@ -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-%]+&?)?$/

Copilot is powered by AI and may make mistakes. Always verify output.
Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
@kkartunov kkartunov merged commit 02d1dc4 into master Feb 26, 2025
3 of 4 checks passed
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.

5 participants