-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[SR-8678] Possible security fail in implementation of multiline/delimited strings #51192
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
Comments
The code for the implementation of SE-200 was structured so that the function diagnoseZeroWidthMatchAndAdvance() could be updated to resolve the problem - at least for string literal delimiters. A possible solution was removed in the finish which contained the following code:
|
Comment by Michael Verges (JIRA) Note for future implementation: The pull request for SR-10011 adds a test case containing zero-width characters within a character sequence that resembles the multi-line delimiter. The implementation of diagnoseZeroWidthMatchAndAdvance may (or may not?) break this test case. If you run into that problem, revisit advanceIfMultilineDelimiter. |
Additional Detail from JIRA
md5: 649261c2424597aabda9e63a57de79a9
Issue Description:
As was pointed out in the tail end of the discussion of SE-200 there is a potential security problem with multiple character string delimiters as are used by multiline strings and soon to be implemented “raw/delimited strings” as demonstrated by the following contrived code:
It contains a zero-width unicode character in the first closing delimiter so this code is treated as one string. In Xcode this mitigated by being syntax highlighted correctly but perhaps there is something here that deserves attention. A possible fix for this is included in the last commit on #17668
The text was updated successfully, but these errors were encountered: