Skip to content

Land #3 (upload images/PDFs) on top of #1, with an upload hardening fix - #4

Merged
lonetis merged 3 commits into
mainfrom
claude/great-gauss-rtc6jf
Oct 20, 2026
Merged

lonetis merged 3 commits into
mainfrom
claude/great-gauss-rtc6jf

Conversation

@lonetis

@lonetis lonetis commented Oct 20, 2026

Copy link
Copy Markdown
Owner

Integrates #3 by @Darrow8 now that #1 (review mode + comments) and #2 (self-hosted session cookies) are merged. #3 no longer merges cleanly on its own, and it had one security gap worth closing before it ships.

What's in here

  1. Merge commit for feat: upload images/PDFs for \includegraphics #3: keeps the contributor's commit (and authorship) intact. The conflicts with feat: review mode (track changes) and comments #1 were all additive, and both sides are kept:
    • src/cli.ts: both the comment/comments and upload usage lines and case blocks
    • src/session.ts: both import groups (randomBytes plus readFile/basename/extname)
    • README.md: the review-mode and comments bullets, plus feat: upload images/PDFs for \includegraphics #3's upload-enhanced "Full document control" bullet
    • CLAUDE.md: uploadFile in the SDK method list, upload_file in the MCP annotation list
  2. fix(upload), two small changes:
    • Local-file relabel bypass. uploadFile only checked the extension of the uploaded name, so path + name could upload any readable local file under an image name. For example, overleaf_upload_file({path: "/home/me/.ssh/id_rsa", name: "fig.png"}) would put a private key into a project shared with collaborators. Through MCP, a prompt-injected instruction inside a document could trigger this. Now the source file's own extension must also be an allowed type. A unit test covers this case.
    • overleaf_upload_file is now destructiveHint: true. It replaces a same-named file, so under the repo's annotation rule it counts as an overwrite tool. CLAUDE.md is updated to match.

Validation

  • npx tsc --noEmit: clean
  • npx vitest run: 93 passed, 25 skipped (the live integration/MCP tests auto-skip without a session)
  • npm run build: clean

Merging this PR should also mark #3 as merged, since #3's head commit becomes part of main.


Generated by Claude Code

Darrow8 and others added 3 commits October 4, 2026 19:46
Add uploadFile to RestClient/ProjectSession/OverleafClient, a `claudeleaf
upload` CLI command and an `overleaf_upload_file` MCP tool (local path or
base64). Allows png/jpg/gif/svg/pdf/eps up to 50 MB; a same-named file in
the folder is replaced.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Brings in Darrow8's upload feature from #3, which
conflicted with the review-mode/comments work merged just before it.
All conflicts were additive; both sides are kept (CLI usage + cases,
session imports, README feature bullets, CLAUDE.md method/annotation
lists).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013JsTRdGXNXoffTBgY4BHpU
uploadFile only validated the extension of the uploaded *name*, so a
local `path` with an explicit `name` could relabel any readable file as
an image (e.g. path ~/.ssh/id_rsa, name figure.png) and upload it into a
project shared with collaborators. Via the MCP tool, a prompt-injected
instruction in a document could exploit that to exfiltrate local files.
The source file's extension must now be an allowed type too.

overleaf_upload_file replaces a same-named file, so per the repo's
annotation convention it is an overwrite tool: destructiveHint true.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013JsTRdGXNXoffTBgY4BHpU
@lonetis
lonetis marked this pull request as ready for review October 20, 2026 09:56
@lonetis
lonetis merged commit 43d994a into main Oct 20, 2026
2 checks passed
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-20T09:57:05.880226Z 831aedc Draft marked ready
🔒 Security Review ✅ Completed 2026-10-20T09:57:56.594374Z 831aedc Draft marked ready
ℹ️ 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.

@lonetis
lonetis deleted the claude/great-gauss-rtc6jf branch October 20, 2026 13:47
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.

3 participants