mirror of
https://github.com/morluto/rea
synced 2026-10-26 06:16:17 -04:00
fix(javascript): reject encoded separators joined by HTML URL whitespace
#1287 removes URL tabs and newlines from an HTML script URL before percent-decoding. A declaration such as %2<newline>fapp.js passed the raw admission check and then decoded to a separator, resolving to a file the encoded-separator rule must refuse. Apply canonical path admission again to the parsed URL text. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -264,6 +264,12 @@ const htmlCandidate = (
|
||||
return unresolvedOutcome(input, "external", [
|
||||
"The document base href is external, so its script reference is not a local artifact path.",
|
||||
]);
|
||||
// Removing URL tabs and newlines can join an encoded dot or separator that
|
||||
// the raw declaration split, so admit the parsed URL text again.
|
||||
if (!admitsCanonicalPathSyntax(declared))
|
||||
return unresolvedOutcome(input, "rejected", [
|
||||
"Encoded dot or separator bytes are rejected before artifact path resolution.",
|
||||
]);
|
||||
const declaredPath = percentDecodeUrlPath(declared);
|
||||
if (declaredPath === null)
|
||||
return unresolvedOutcome(input, "rejected", [
|
||||
|
||||
Reference in New Issue
Block a user