Repository navigation
Land #3 (upload images/PDFs) on top of #1, with an upload hardening fix - #4
Merged
Merged
Conversation
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
marked this pull request as ready for review
October 20, 2026 09:56
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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.
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
src/cli.ts: both thecomment/commentsanduploadusage lines andcaseblockssrc/session.ts: both import groups (randomBytesplusreadFile/basename/extname)README.md: the review-mode and comments bullets, plus feat: upload images/PDFs for \includegraphics #3's upload-enhanced "Full document control" bulletCLAUDE.md:uploadFilein the SDK method list,upload_filein the MCP annotation listfix(upload), two small changes:uploadFileonly checked the extension of the uploaded name, sopath+namecould 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_fileis nowdestructiveHint: true. It replaces a same-named file, so under the repo's annotation rule it counts as an overwrite tool.CLAUDE.mdis updated to match.Validation
npx tsc --noEmit: cleannpx vitest run: 93 passed, 25 skipped (the live integration/MCP tests auto-skip without a session)npm run build: cleanMerging this PR should also mark #3 as merged, since #3's head commit becomes part of
main.Generated by Claude Code