Skip to content

Match allowed link hosts on a literal dot - #3410

Merged
pwizla merged 1 commit into
mainfrom
repo/fix-external-links-regex
Aug 26, 2026
Merged

Match allowed link hosts on a literal dot#3410
pwizla merged 1 commit into
mainfrom
repo/fix-external-links-regex

Conversation

@pwizla

@pwizla pwizla commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

The #3366 eligibility run surfaced an awk warning in the summary table, on the no-external-links row. 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 warns escape sequence \. treated as plain . — so the dot became a wildcard.

The consequence: https://strapiXio.evil.com matched strapi.io and was accepted as an allowed host. A lookalike domain would have passed the check.

Writing the dots as [.] survives -v untouched and means exactly one literal dot.

Verified:

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.
@pwizla pwizla self-assigned this Aug 26, 2026
@vercel

vercel Bot commented Aug 26, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
documentation Ready Ready Preview Aug 26, 2026 2:34pm

Request Review

@github-actions github-actions Bot added internal PRs created by the Strapi core team pr: chore source: repo PRs/issues not targeting a specific documentation but rather affecting the whole repo labels Aug 26, 2026

@pwizla pwizla left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good 👌 🚀

@pwizla
pwizla merged commit 11e2f60 into main Aug 26, 2026
9 checks passed
@pwizla
pwizla deleted the repo/fix-external-links-regex branch August 26, 2026 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal PRs created by the Strapi core team pr: chore source: repo PRs/issues not targeting a specific documentation but rather affecting the whole repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant