Skip to content

Conversation

@kkartunov
Copy link
Collaborator

Potential fix for https://github.com/topcoder-platform/platform-ui/security/code-scanning/69

To fix this issue, we should ensure that all asterisks (*) and underscores (_) in the string are removed, not just the first occurrence. This is best accomplished by changing the regular expression in replace() to use the global modifier g, i.e., /(\*|_)/g. This pattern will now replace every asterisk or underscore in the string with an empty string, which is the intended behavior for sanitizing formatting elements in Markdown. The change should be made on line 138 of src/apps/review/src/lib/components/FieldMarkdownEditor/FieldMarkdownEditor.tsx, replacing /(\*|_)/, '' with /(\*|_)/g, ''. No new imports or function definitions are necessary.


Suggested fixes powered by Copilot Autofix. Review carefully before merging.

…ing or encoding

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@kkartunov kkartunov marked this pull request as ready for review December 12, 2025 07:09
@kkartunov kkartunov requested a review from jmgasper as a code owner December 12, 2025 07:09
@kkartunov kkartunov merged commit f1ffcf0 into dev Dec 12, 2025
8 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.

2 participants