-
Notifications
You must be signed in to change notification settings - Fork 2
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
Fix test ID queries not properly escaping RegExps #44
Conversation
Security InsightsNo security relevant content was detected by automated scans. Action Items
Questions or Comments? Reach out on Slack: #support-infosec. |
final testIdMatcher = exact ? RegExp('(\\s|^)$testId(\\s|\$)') : RegExp('(.?)$testId(.?)', caseSensitive: false); | ||
final testIdMatcher = exact | ||
? RegExp('(\\s|^)${RegExp.escape(testId as String)}(\\s|\$)') | ||
: RegExp('(.?)${RegExp.escape(testId as String)}(.?)', caseSensitive: false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These as String
s are needed to fix implicit cast errors, since testId hasn't been promoted to String
here like you'd expect it to (which I believe is fixed in null safety)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
d3c235a
QA +1
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
@Workiva/release-management-pp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 from RM
Motivation
Our logic that converts test IDs to RegExps for querying doesn't escape the test IDs properly, meaning any regular expression syntax in test IDs will cause unexpected behavior (including false negatives, false positives, and runtime errors, based on the input).
Changes
Release Notes
Review
See CONTRIBUTING.md for more details on review types (+1 / QA +1 / +10) and code review process.
QA Checklist
Merge Checklist
While we perform many automated checks before auto-merging, some manual checks are needed: