build: centralize MediaWiki plural rules source URL - #45
Merged
kanasimi merged 1 commit intoSep 30, 2026
Merged
Conversation
Owner
|
Since the URL is validated before the |
The prior CWE-918/SSRF framing didn't hold up on review: the URL is a hardcoded constant, read exactly once at the fetch() call site, with no path into it from resources_path, env vars, CLI args, or any other input. The added regex check validated the constant against a pattern derived from that same constant, so it could never fail and didn't demonstrate a real trust boundary. Keep the one useful part of the original change and drop the rest: name the URL as gettext_plural_rules_source_URL instead of inlining it, and remove the redundant validation branch and comment. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
anupamme
force-pushed
the
fix-repo-cejs-cwe-918-ssrf-url-validation
branch
from
September 30, 2026 01:24
2de03a3 to
2a024e6
Compare
Contributor
Author
|
You're right that the URL is currently hard-coded, so the SSRF validation I added is redundant and doesn't demonstrate a meaningful security boundary. I've revised the PR to remove the SSRF claim and reworked the change to centralize the MediaWiki source URL in a single named constant, used at the one If there's a future requirement to make the source configurable, URL validation should be added at that configuration/input boundary rather than around this hard-coded value. |
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.
Summary
The original title/framing of this PR claimed a CWE-918 (SSRF) fix, but that didn't hold up: the URL fetched in
_build/build.nodejs.jsis a hardcoded string constant, read exactly once at thefetch()call site, with no path into it fromresources_path, environment variables, CLI arguments, or any other input. The regex check I'd added validated that constant against a pattern derived from the same constant — it could never fail, so it didn't demonstrate a real security boundary.I've reworked the change to keep the one genuinely useful part: extracting the URL into a named
gettext_plural_rules_source_URLconstant instead of an inline literal in thefetch()call. The redundant validation branch and the CWE-918 comment have been removed.What changed
_build/build.nodejs.js: name the MediaWiki plural-rules source URL as a constant; drop the no-op URL validation.Note
If the source URL ever becomes configurable (env var, CLI flag, etc.), URL validation should be added at that new input boundary, not here.