- Notifications
You must be signed in to change notification settings - Fork5.4k
Commitc62afc9
fix(security): Incomplete multi-character sanitization in GitHub Actions script (#36072)
Potential fix for[https://github.com/MetaMask/metamask-extension/security/code-scanning/202](https://github.com/MetaMask/metamask-extension/security/code-scanning/202)To fix this incomplete multi-character sanitization, apply thereplacement repeatedly until no more changes are made. This ensures thatall HTML comments, including any introduced as replacements expose newtags, are fully removed. The best approach in this setting is to wrapthe replace operation in a do-while loop, repeatedly removing HTMLcomments until the string remains unchanged. This will not affect otheruses of the string and preserves current functionality, ensuring robustremoval of all comment tags.All changes are confined to the `hasChangelogEntry` function in`.github/scripts/check-template-and-add-labels.ts`, specifically line412. No additional imports or new dependencies are needed.---_Suggested fixes powered by Copilot Autofix. Review carefully beforemerging._<!-- CURSOR_SUMMARY -->---> [!NOTE]> Harden `hasChangelogEntry` to repeatedly remove HTML comments untilstable (with a 100-iteration safety cap) before validating the changelogline.> > - **GitHub Actions script**(`.github/scripts/check-template-and-add-labels.ts`)> - **Changelog parsing**: Update `hasChangelogEntry` to iterativelystrip HTML comments until no further changes, capped at 100 iterationswith a warning.> - Maintains existing logic for extracting and validating the`CHANGELOG entry:` line after comment removal.> > <sup>Written by [CursorBugbot](https://cursor.com/dashboard?tab=bugbot) for commit72711dd. This will update automaticallyon new commits. Configure[here](https://cursor.com/dashboard?tab=bugbot).</sup><!-- /CURSOR_SUMMARY -->---------Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>1 parent5957159 commitc62afc9
1 file changed
+13
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
409 | 409 | | |
410 | 410 | | |
411 | 411 | | |
412 | | - | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
413 | 425 | | |
414 | 426 | | |
415 | 427 | | |
| |||
0 commit comments
Comments
(0)