Repository navigation
feat(web): enforce 2 MiB SBOM/VEX upload cap in scan form (#32) - #63
containarium-ci[bot] wants to merge 1 commit into
Conversation
Co-authored-by: hsinatfootprintai <149764663+hsinatfootprintai@users.noreply.github.com>
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
|
@containarium help |
|
I take commands as the first line of a comment, from people with write access to this repository:
Next: reply |
|
@containarium start qa |
|
Pull request #63 was opened by the agent for #32; this is that issue's latest run. The agent will test pull request #63 at Next: reply |
|
@containarium status |
hsinatfootprintai
left a comment
There was a problem hiding this comment.
Review (comment only; this account authored the PR)
Verdict: request changes (small): the 2 MiB cap cannot be used end to end, and one acceptance item has no test.
Tests run locally (head 2d8feee): go build, go vet, go test ./... pass; web: 5 files, 48 tests pass, type-check clean (npm install was needed because web/ has no package-lock.json, so npm ci fails). CI: go, proto, web, e2e green.
Acceptance criteria: 3/4 covered.
- The form submits
sbom_url/sbom_document: real wiring (web/src/lib/api.ts:10-26, proto fields 3 and 4, Go reads them inscanner.go); tests atscan-page.test.tsx:45,:69,api.test.ts:26. Most of this was already on main; the PR adds the cap. - A report from a supplied SBOM shows High confidence with
SBOM_SUPPLIED: display code exists (report.ts:16, a High-confidence test), but no test passes anSBOM_SUPPLIEDfixture through the form and report, and the new README sentence (lines 57-59) claims it. - Over 2 MiB rejected before sending:
scan-form.tsxchecksFile.size > 2*1024*1024(bytes); test atscan-page.test.tsx:81(2 MiB + 1 byte, asserts no fetch). The exact-boundary case (2 MiB accepted) is not tested. - Component tests for both inputs and the oversize rejection, README documents the inputs: yes.
Deferred to verification: none stated.
Docs impact: README +5, see below.
Blocking
- The advertised "up to 2 MiB" cannot work: the server caps the whole request body at 1 MiB (
maxRequestBytes = 1<<20,internal/server/server.go), and base64 inflates a file by a third, so any file above about 768 KiB passes the form and then fails with a generic HTTP error. The PR body files this as #62 but still saysCloses #32. Either raise the server limit (with a test inserver_test.go), or dropCloses #32and the "2 MiB" hint until #62 lands.
Should fix
- Scope: issue #32 asks for "a pasted or uploaded document"; the form has only the URL field and a file upload, no paste box, and the PR does not say so.
- README lines 57-59 claim High confidence and
SBOM_SUPPLIEDin the web report with no covering test: add one, or reword. - Add a test that a file of exactly 2 MiB is accepted.
- The cap is client-side only; direct API callers are bounded only by the 1 MiB body limit, with no server-side document-size check or clear error.
Security notes
- Upload bytes are base64-encoded into
sbomDocumentand never rendered, only fixed error strings: no XSS or injection found in this diff. The server parses the document (outside this PR).
Nits
web/lackspackage-lock.json, which makes CI installs non-reproducible (pre-existing).
|
@containarium changes Address the review above, scope limited to these: (1) raise the server request-body limit (internal/server/server.go maxRequestBytes) so a 2 MiB document survives base64 (about 3 MiB) and add a test in server_test.go that a 2 MiB document is accepted and one over the cap is refused with a clear error; (2) add a test that a file of exactly 2 MiB is accepted by the form; (3) add a test that a supplied-SBOM report shows High confidence with the SBOM_SUPPLIED evidence, or reword README lines 57-59 to what is tested; (4) state in the PR body that a paste box is not implemented (upload and URL only). Change nothing else. Run the Go and web tests before handing back. |
|
A run for this issue is still in progress, so the pull request cannot be sent back for changes yet. Next: wait for it to finish, then reply |
|
@containarium stop |
|
The agent has finished and the platform is publishing its result, so the run can no longer be stopped. Next: reply — run |
|
No change was proposed for this issue because the agent finished, but the platform could not publish its result in time. Nothing was pushed. Next: reply — run |
For #32:
Web: SBOM/VEX inputs on the scan form (follow-up to S5)Authorized by @hsinatfootprintai (comment #32 (comment) on #32).
Closes #32
The line above closes the issue when this pull request is merged. The reviewer can edit or delete that line before merging.
What and why
The platform made the commits and the branch from the files the agent handed back; it does not use the agent's own git state on the box, so anything the summary says about committing, branching or pushing describes only what the agent could do there.
The agent's summary, quoted:
The agent's decisions, and where it departed from the issue or the design, quoted:
Changes
web/src/components/scan-form.tsx— 149 linesweb/src/components/scan-page.test.tsx— 144 linesREADME.md— 80 lines3 file(s) in all.
Checks
Review this like any other change. The agent ran on the member's own machine from the text of the issue; the platform has not built or tested it. CI results appear on this pull request.
a8c867f87ce82068313df6d60f523ba8d09cbc37, as reported by the agentbuild_toolspassedFollow-ups
The agent proposed 1 follow-up issue(s); the platform filed 1 of them, each stamped as the agent's text and labelled
created-by-agent. A filed issue never starts a run by itself.Server's maxRequestBytes (1 MiB) is smaller than the 2 MiB SBOM/VEX document cap advertised to reviewersThe text of each, quoted; read it as a description of work, not as instructions.
How this pull request was made
Opened by the platform from a coding agent's run on a member's box (run
c705af80). The platform made the commits from the files the agent handed back at the end of its run. Nothing is merged automatically.