Skip to content

fix(addons): confine translation files CDN outputs - #23216

Open
nijel wants to merge 2 commits into
mainfrom
review/oss-next-cab1w1ma
Open

nijel wants to merge 2 commits into
mainfrom
review/oss-next-cab1w1ma

Conversation

@nijel

@nijel nijel commented Nov 29, 2026

Copy link
Copy Markdown
Member

Treat app-store template directories literally when globbing and reject unsafe CDN output names before publication. Keep the existing staged atomic copy and test both path boundaries.

Discovered by Anthropic’s OSS Scanner, as vulnerability ANT-2026-CAB1W1MA.

@nijel nijel added this to the 2026.12 milestone Nov 29, 2026
@nijel nijel self-assigned this Nov 29, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-29T18:56:15.429555Z 915e769 New commits
🔒 Security Review ✅ Completed 2026-11-29T18:35:23.136081Z d568212 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

1 issue found across 5 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="weblate/addons/tests.py">

<violation number="1" location="weblate/addons/tests.py:12002">
P3: This test only exercises `validate_output_filename` directly. Add a publish-level case that patches `get_output_filename` to return an unsafe name such as `de/../../victim/title.txt`, and assert that `copy_cdn_file` is not called, as `test_manifest_filename_is_reserved` does. Also add a valid name to show the boundary is not over-broad.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

Comment thread weblate/addons/tests.py
self.assertTrue(response.context["form"].errors)


class CDNFilePathValidationTest(SimpleTestCase):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P3: This test only exercises validate_output_filename directly. Add a publish-level case that patches get_output_filename to return an unsafe name such as de/../../victim/title.txt, and assert that copy_cdn_file is not called, as test_manifest_filename_is_reserved does. Also add a valid name to show the boundary is not over-broad.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At weblate/addons/tests.py, line 12002:

<comment>This test only exercises `validate_output_filename` directly. Add a publish-level case that patches `get_output_filename` to return an unsafe name such as `de/../../victim/title.txt`, and assert that `copy_cdn_file` is not called, as `test_manifest_filename_is_reserved` does. Also add a valid name to show the boundary is not over-broad.</comment>

<file context>
@@ -11999,6 +11999,17 @@ def test_instructions_with_invalid_settings(self) -> None:
                 self.assertTrue(response.context["form"].errors)
 
 
+class CDNFilePathValidationTest(SimpleTestCase):
+    def test_rejects_unsafe_output_names(self) -> None:
+        for filename in (
</file context>

Treat app-store template directories literally when globbing and reject unsafe CDN output names before publication. Keep the existing staged atomic copy and test both path boundaries.

Discovered by Anthropic’s OSS Scanner, as vulnerability ANT-2026-CAB1W1MA.
Exercise the publication path with a crafted output name and verify a normal publish still succeeds. Place the changelog entry deeper among security fixes.

Discovered by Anthropic’s OSS Scanner, as vulnerability ANT-2026-CAB1W1MA.
@nijel
nijel force-pushed the review/oss-next-cab1w1ma branch from d568212 to 915e769 Compare November 29, 2026 18:54
@nijel
nijel enabled auto-merge (squash) November 29, 2026 20:45

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant