Repository navigation
fix(security): treat empty bulk advisory response bodies as non-retryable - #196
Merged
Merged
Conversation
|
I'll analyze this and get back to you. |
There was a problem hiding this comment.
LGTM. Clean follow-up to #195 — resolves the cubic-dev-ai comment cleanly.
EEMPTYBODYcode mirrors the existingETOOBIG/SyntaxErrortreatment (deterministic malformed-response → don't retry).- Test asserts
callCount === 1on empty body, and the classifier unit-test case is added. - 22/2 line diff, security-fast + all CI green, no scope creep.
Ship it.
Willi8910
approved these changes
Sep 4, 2026
convyusboy
added a commit
that referenced
this pull request
Sep 4, 2026
Live-verified (2026-09-04): a bulk advisory request to registry.npmjs.org containing only "@a2ui/web_core" hangs indefinitely -- confirmed twice, 15-20s+ each time, zero bytes received -- even though the package's own registry metadata resolves normally in under a second. Not payload-size related: it reproduces with this single package alone, and blocks security-fast on every PR that pulls it in as a production dependency (the canvas extension's a2ui bundle), not just ones that touch it. The existing retry-once mechanism (#195, #196) doesn't help since it retries the identical request against the same broken endpoint behavior. Exclude it from the bulk request entirely (not just filter it from findings afterward) so the rest of production dependencies still get audited. Remove once npm fixes the underlying advisory-lookup bug for this package.
convyusboy
added a commit
that referenced
this pull request
Sep 4, 2026
) * fix(browser-handoff): make the scheduled recheck actually re-check Live-verified on arief-openclaw-test: a resumed cron turn would sometimes end silently without ever calling browser_handoff action="status" at all -- confirmed via boon-core's own request logs, which show zero GET /browser_handoff/status calls for a cron-resumed turn that nonetheless completed normally. The resumed model appears to pattern-match the old wording's "if it's still pending, end your turn without replying" against its own recent context (it had just told the customer moments earlier that sign-in hadn't come through) and answer from memory instead of actually checking again -- silently breaking the recheck chain, since handleStatus (the only place that reschedules the next check) never runs. Rewrite the scheduled message to remove that shortcut: state up front that whatever the model already believes is stale, and make the tool call the first, unconditional action for the turn rather than one leg of a conditional the model can reason its way around. * fix(browser-handoff): validate site as a hostname at the tool boundary Review feedback: site is model-supplied and gets interpolated directly into scheduled-turn and reply prompt text in several places (schedule recheck's message, the request_login reply, status/error text). A value containing quotes, newlines, or instruction-like text there is a prompt-injection surface. site is documented as a hostname (e.g. "app.procore.com"), so validate it as one at readSite -- the actual boundary where model-supplied args enter the tool -- rather than trying to escape it at every interpolation site. * fix(browser-handoff): cap hostname length, fix a non-exercising test Review feedback: HOSTNAME_PATTERN bounded each label to 63 characters but not the total hostname length, so an arbitrary number of valid labels could still produce an unbounded string -- one that then gets embedded in prompts and used to build state/schedule keys. Add the standard 253-character total-length bound. Also fixes a test that claimed to cover newline rejection but whose fixture contained no actual newline character -- it was passing for the wrong reason (the quote/instruction-text portion alone already failed validation). The fixture now includes a real newline. * fix(security): exclude @a2ui/web_core from the bulk advisory request Live-verified (2026-09-04): a bulk advisory request to registry.npmjs.org containing only "@a2ui/web_core" hangs indefinitely -- confirmed twice, 15-20s+ each time, zero bytes received -- even though the package's own registry metadata resolves normally in under a second. Not payload-size related: it reproduces with this single package alone, and blocks security-fast on every PR that pulls it in as a production dependency (the canvas extension's a2ui bundle), not just ones that touch it. The existing retry-once mechanism (#195, #196) doesn't help since it retries the identical request against the same broken endpoint behavior. Exclude it from the bulk request entirely (not just filter it from findings afterward) so the rest of production dependencies still get audited. Remove once npm fixes the underlying advisory-lookup bug for this package. * fix(security): warn loudly instead of silently on excluded packages Review feedback: silently excluding a package from the bulk advisory request means it was never checked, but the check still reports success -- indistinguishable from full coverage. Excluding it from the bulk endpoint request is still necessary (the endpoint hangs on it regardless of batch size, confirmed by testing it in isolation), so make the gap impossible to miss instead: print a clear warning naming the package whenever it's actually a production dependency, so a passing security-fast never silently implies full coverage. Also renames the exclusion test to describe the asserted behavior instead of reading like an incident report. * fix(security): correct the all-excluded message, strengthen a test Review feedback: when the only production dependency present was the excluded package, the audit reported "No production dependencies found" -- misleading, since a dependency was found, it was just excluded (and the SECURITY WARNING above it already says so). Give that case its own message that doesn't contradict the warning just printed. Also strengthens the "no warning" negative test: it previously proved only that an absent package produces no warning, not that a package present as a devDependency (non-production) does not. The fixture now includes @a2ui/web_core as an explicit devDependency so the test actually exercises the scenario its name claims.
insomnius
added a commit
that referenced
this pull request
Sep 4, 2026
…200) Ships #198 (ENG-19115) — the gateway-audience OBO finally reaches the wire: agent-runner-utils builds the primary-turn sender context from run.oboToken and run.ts copies it into the attempt params, verified end to end on a local stack (gateway fetched the org signing key and verified the token). Also #197 browser-handoff recheck, #194 sentry-monitor tenant tag + hook allow-list, #195/#196 CI dependency-audit hardening. Lockstep bump via release:prep; CHANGELOG.md gains the 2026.6.11-boon.37 section the prepack requires.
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 Problem This Solves
Follow-up to #195. A comment on #195 (from cubic-dev-ai, confidence 10) was left unresolved because the PR was merged before it could be addressed: the retry classifier added in #195 treats a successful (200) response with an empty body as retryable, since it falls through the default
return truebranch. An empty body from a 200 response is the same class of deterministic, malformed-response failure as the JSON-parse case already excluded from retry — retrying it just adds a 2s delay plus a duplicate request before reporting the same finding.Why This Change Was Made
Marks the empty-body error with a dedicated
EEMPTYBODYcode and excludes it inisRetryableBulkAdvisoryError, consistent with howETOOBIGandSyntaxError(JSON parse) are already excluded.User Impact
None for real advisory findings — only changes how fast the
security-fastcheck reports a deterministic empty-body failure (immediately, instead of after one wasted retry).Evidence
scripts/pre-commit/pnpm-audit-prod.mjs:readBulkAdvisoryJsonnow throwsObject.assign(new Error(...), { code: "EEMPTYBODY" });isRetryableBulkAdvisoryErrornow returnsfalsefor that code.test/scripts/pnpm-audit-prod.test.ts: added a test proving no retry happens on an empty body (callCountstays 1) and a classifier unit-test case forEEMPTYBODY.node scripts/run-vitest.mjs test/scripts/pnpm-audit-prod.test.ts→ 28/28 passed.Summary by cubic
Treats 200 responses with an empty bulk advisory body as non-retryable so
security-fastreports the failure immediately instead of after one wasted retry.EEMPTYBODYcode inreadBulkAdvisoryJson.EEMPTYBODYinisRetryableBulkAdvisoryError, matching the existingETOOBIGand JSON-parse exclusions.Written for commit 546bf89. Summary will update on new commits.