Fix security vulnerabilities and bugs from codebase review#4
Closed
Fix security vulnerabilities and bugs from codebase review#4
Conversation
Co-authored-by: cervonwong <44718681+cervonwong@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Review codebase for bugs and vulnerabilities
Fix security vulnerabilities and bugs from codebase review
Mar 10, 2026
Owner
|
@claude Do you agree with these changes. |
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.
Comprehensive codebase review surfaced several security vulnerabilities, a shared-state mutation bug, and missing cleanup in React hooks.
Security
/api/creditschanged from GET (key in?key=) to POST (key in request body). Query params persist in browser history, server access logs, and proxy logs.loadEvalRun— Added UUID format validation onidandresolve()+startsWith()containment check on the resolved path.readExampleProblem— Added containment check ensuring resolved path stays withinexamples/directory. Data is currently hardcoded but this is defense-in-depth.JSON.parsein eval storage — Corrupted JSON files inloadEvalRuns/loadEvalRuncrashed the process; now wrapped in try-catch with warning logs.Bugs
02d-synthesize.ts) —mainVocabulary.set(key, entry)stored a reference to draft vocabulary entries, so mutations to one affected the other. Changed to{ ...entry }, consistent with the spread pattern already used increateDraftStore.getDraftStoresMap— Whendraft-storeswas missing fromrequestContext, the function silently created a newMapthat was never persisted back. Subsequent calls would get a fresh empty Map, losing all draft stores. Now throws explicitly since the hypothesize step is required to initialize it.Code quality
AbortControllerincredits-badge.tsxanduse-examples.ts— Added cleanup to cancel in-flight fetches on unmount/dependency change.rcGettertype cast in03a-rule-tester-tool.ts— Removed redundant wrapper that castundefinedthroughas Parameters<...>[0];emitToolTraceEventalready acceptsundefined.✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.