Code Scanning fixed#1
Open
ElfredSeow wants to merge 1 commit into
Open
Conversation
| bestCandidateLength: bestCandidate.length, | ||
| bestCandidateHash: createHash("sha1").update(bestCandidate).digest("hex").slice(0, 12), | ||
| // ponytail: non-security fingerprint for diagnostics, not a password; sha256 to silence weak-algo scan | ||
| bestCandidateHash: createHash("sha256").update(bestCandidate).digest("hex").slice(0, 12), |
Comment on lines
+518
to
+522
| targetHtml = targetHtml | ||
| .replace( | ||
| /<(script|style|noscript|nav|footer|header|aside|svg)\b[^>]*>[\s\S]*?<\/\1\s*>/gi, | ||
| "", | ||
| ) |
| .replace(/<style[\s\S]*?<\/style>/gi, " ") | ||
| .replace(/<script[\s\S]*?<\/script>/gi, " ") | ||
| .replace(/<style\b[\s\S]*?<\/style\s*>/gi, " ") | ||
| .replace(/<script\b[\s\S]*?<\/script\s*>/gi, " ") |
| .replace(/<style[\s\S]*?<\/style>/gi, " ") | ||
| .replace(/<script[\s\S]*?<\/script>/gi, " ") | ||
| .replace(/<style\b[\s\S]*?<\/style\s*>/gi, " ") | ||
| .replace(/<script\b[\s\S]*?<\/script\s*>/gi, " ") |
Comment on lines
+175
to
+178
| const escaped = String(inner) | ||
| .replace(/\\'/g, "'") // \' is a literal ' inside the single-quoted source; invalid in JSON | ||
| .replace(/\\"/g, '"') | ||
| .replace(/"/g, '\\"'); |
| return htmlContent | ||
| .replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, " ") | ||
| .replace(/<style\b[^<]*(?:(?!<\/style>)<[^<]*)*<\/style>/gi, " ") | ||
| .replace(/<script\b[^<]*(?:(?!<\/script\s*>)<[^<]*)*<\/script\s*>/gi, " ") |
Comment on lines
+34
to
+38
| html = html | ||
| // Remove executable and embeddable content. | ||
| .replace(/<script\b[\s\S]*?<\/script\s*>/gi, "") | ||
| .replace(/<script\b[^>]*>/gi, "") | ||
| .replace(/<(iframe|object|embed)\b[\s\S]*?<\/\1\s*>/gi, "") |
Comment on lines
+34
to
+37
| html = html | ||
| // Remove executable and embeddable content. | ||
| .replace(/<script\b[\s\S]*?<\/script\s*>/gi, "") | ||
| .replace(/<script\b[^>]*>/gi, "") |
Comment on lines
+34
to
+36
| html = html | ||
| // Remove executable and embeddable content. | ||
| .replace(/<script\b[\s\S]*?<\/script\s*>/gi, "") |
| previous = html; | ||
| html = html | ||
| // Remove executable and embeddable content. | ||
| .replace(/<script\b[\s\S]*?<\/script\s*>/gi, "") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Related Issue
Fixes #
Type of Change
Reliability Regression Policy
scripts/qa/eval-cases/.scripts/qa/eval-cases/...Category
Changes Made
Security Considerations
Screenshots
Testing
Checklist
docs/architecture.mdif this PR changes capabilities, defaults, or architectureAdditional Notes