Repository navigation
Conversation
…any label POST /api/github/create-issue turned every request into a public issue on MeshJS/multisig using the project's GITHUB_TOKEN: any method, no session, no rate limit, and `type` passed straight into `labels`, so a script could flood the repo and attach (with a push-scoped token, create) arbitrary labels. A missing title made Octokit throw an unhandled 500. The handler now takes POST only, requires the app's wallet session (the "Create a ticket" button is only shown to signed-in users), validates and bounds title/body/type (400 instead of 500), caps the request at 16 KB, limits each IP to 5 filed reports per 10 minutes (rejected requests don't count), and answers 502 without echoing GitHub's error text. The dialog no longer hangs on its spinner when the request fails: it keeps the text, shows the server's reason in a toast, and disables submit while title or body is empty. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L881FoNAawqTZFuZmkJCGd
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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.
What
POST /api/github/create-issue(the in-app "Create a ticket" dialog) turned every request into a public issue on MeshJS/multisig, written with the project'sGITHUB_TOKEN:typewent straight intolabels, so callers could attach any label (and, with a push-scoped token, create new ones);Change
src/pages/api/github/create-issue.ts405+Allow: POSTotherwise)./api/pinata-storage/put). The button is only rendered for signed-in users (layout.tsx,isLoggedInbranch). The cookie isSameSite=Lax, so other sites can't file through a visitor's browser. I didn't add an Origin check becausevalidateOriginwould also needCORS_ORIGINSto list the app's own origin.parseIssueReport: title 1–200 chars, body 1–5000 chars (both trimmed),type∈ {bug,enhancement} →400otherwise. Requests over 16 KB →413.applyStrictRateLimit). The limit is applied after the auth and validation checks, so a user who hits "title is required" a few times isn't locked out.502with a generic message; the details go to the server log.dialog-report-wrapper.tsxTests
src/__tests__/githubCreateIssue.test.ts: 21 tests (validation table, 405/401/400/413/429/503/502, trimmed payload, rejected requests not counted against the limit). Against the old handler, 17 of the 19 initial tests fail.npx tsc --noEmit: clean.node scripts/run-tests.mjs: 151 suites / 1677 tests passed (2 skipped) + ESM 11 suites / 97 tests passed.next build --webpack+check-bundle-budget --report: within budget, no route changed by more than 0.1 KB.Not verified / open
src/components/common/overall-layout/dialog-report.tsxis dead code (nothing imports it) and is left untouched.Generated by Claude Code