Refuse a sandboxed component whose title is only whitespace - #393
Open
kevin9327 wants to merge 1 commit into
Open
Refuse a sandboxed component whose title is only whitespace#393kevin9327 wants to merge 1 commit into
kevin9327 wants to merge 1 commit into
Conversation
kevin9327
requested review from
MikeRyanDev,
davidmckayv,
guidovizoso and
tylerslaton
as code owners
September 5, 2026 22:09
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
9 tasks
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 this changes
POST /api/sandboxedtook a title of spaces and stored it. The guard checked the field was present,not that it said anything:
The slug is safe:
SandboxedStore.saveruns it against^[a-z0-9][a-z0-9_]{0,38}[a-z0-9]$andrefuses one made of spaces. The title has no check anywhere and is inserted verbatim, so the
component lands in the playground grid with nothing to read, and a Bot granted it is told the
component is called
" ".This is the third endpoint of that exact shape. #376 fixed
POST /api/servers/customand #377 fixedPOST /api/skillsyesterday, both by trimming and refusing whitespace; this one was not in eitherdiff. The change here is the same two lines.
Where it runs
only the body.
savestill upserts onsandboxedComponents.name.Boundary and audit
requireAdmin.same class the two sibling endpoints answer without an audit row.
trusted than before.
Changelog
CHANGELOG.mdunderUnreleased.Proof
server/tests/sandboxed-routes.test.ts, new. The two sibling fixes shipped without tests, so thisadds the ones that pin the behaviour for this route:
refuses a title that is only whitespace— 400, and the store is never called.refuses a missing title, as it always did— the guard that already worked still works.stores a padded title without its padding—" Weather card "is saved as"Weather card".leaves an ordinary title alone— no change to the ordinary path.Before this change, two of the four fail:
After: 4 pass.
bunx tsc --noEmitinserver/is clean, andbunx biome checkon both files isclean.