Match allowed link hosts on a literal dot - #3410
Merged
Merged
Conversation
The host list was written with backslash-escaped dots and passed to awk through -v, where a backslash is a string escape rather than a regex one. awk consumed it, gawk warned "escape sequence \. treated as plain .", and the dot became a wildcard: https://strapiXio.evil.com was accepted as an allowed host. Writing the dots as [.] survives -v untouched. Verified: the four legitimate hosts still pass, strapiXio.evil.com and notstrapi.io are now blocked, and the warning that appeared in the #3366 run summary is gone.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
The #3366 eligibility run surfaced an awk warning in the summary table, on the
no-external-linksrow. It turned out to be a functional bug, not just noise.The allowed-host list was written with backslash-escaped dots and passed to awk through
-v, where a backslash is a string escape rather than a regex one. awk consumed it — gawk warnsescape sequence \. treated as plain .— so the dot became a wildcard.The consequence:
https://strapiXio.evil.commatchedstrapi.ioand was accepted as an allowed host. A lookalike domain would have passed the check.Writing the dots as
[.]survives-vuntouched and means exactly one literal dot.Verified:
strapi.io,docs.strapi.io,www.strapi.ioandgithub.com/strapistill passstrapiXio.evil.com,notstrapi.ioandevil.comare now blocked.mtsESM syntax support #3080, which adds a real link to v6.vite.dev