Conversation
…nformed Customers asked to explain findings (accepted-by-design rationale, remediation notes) so a retest doesn't blindly re-flag them (CS request: 'how do i run retest with the additional context i provided instead of another blind pentest'). - add SecurityPenetrationTestFindingContext table (+migration): one note per org+provider issue, grouped by normalized target URL - new /v1/pentest-finding-contexts endpoints: GET list by target (pentest:read), PUT/DELETE per finding (new pentest:update action, granted to owner/admin); MCP tool names + OpenAPI metadata included - createReport now composes Maced's additionalContext from the new optional additionalContext DTO field plus all saved notes for the target, so every re-run is an informed retest - app: permission-gated 'Retest context' editor on FindingDetail, optional run-level context field + auto-share hint on CreateRunPanel - regenerate packages/docs/openapi.json - tests: util/service/controller specs (api), FindingContextSection + CreateRunPanel payload tests (app); fix pre-existing controller spec load failures by mocking permission.guard/@db Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The markdown and PDF reports come from the provider and never showed the customer's finding-context notes — the artifact handed to auditors lost exactly the justifications the notes exist for. - report-appendix.util.ts: render notes as a clearly attributed 'Appendix: Customer context & management responses' — appended section for markdown, appended pages (pdf-lib, NdaPdfService idioms) for PDF; WinAnsi-safe sanitization, word wrap, pagination - getReportOutput/getReportPdf attach the appendix for the run's target; zero notes -> byte-identical passthrough; notes-lookup or PDF-parse failures are logged and the original provider artifact is served unchanged (appendix is additive, never load-bearing) - tests: 11 new (util markdown/pdf/pagination/unicode/corrupt-input + service append/fallback paths), module suite now 95 passing Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…upsert Validate the normalized target instead of the raw string so a whitespace-only provider URL can't persist a note with an empty target that no future scan lookup could match (cubic review). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
feat(pentest): let customers add context to findings so retests are informed
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
There was a problem hiding this comment.
3 issues found across 31 files
Confidence score: 3/5
- In
apps/api/src/security-penetration-tests/security-penetration-tests.service.ts, the finding-context lookup can fail closed and block pentest creation if the DB call errors, which risks user-facing request failures during transient outages — make this lookup best-effort (log and continue) before merging. - In
apps/api/src/security-penetration-tests/finding-context.util.ts, trimming trailing/on the full URL can alter query parameter values and create incorrect finding-context keys, causing mismatches or duplicate context records — normalize only the path portion (or use URL parsing) and add a regression test before merging. - In
apps/api/src/security-penetration-tests/report-appendix.util.ts, long unbroken tokens are not wrapped in generated PDFs, so notes with long URLs/IDs can overflow margins and become unreadable for customers — add hard-wrap behavior for overlong tokens (with a fixture test) before merging.
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
- createReport notes lookup is now best-effort via the shared quiet helper: a DB failure (transient outage or table missing mid-deploy) logs and proceeds with the caller's own context instead of blocking pentest creation - normalizeTargetUrl strips trailing slashes from the path only, so a '/' at the end of a query value is preserved instead of corrupting the finding-context key - PDF appendix wrapper hard-breaks unbroken tokens (long URLs/IDs) that exceed the line width instead of overflowing the margin Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The three cubic findings on the pentest finding-context feature are fixed in #3112 (targeting main, so it'll flow into this deploy once merged):
All three have regression tests; module suite at 100 passing. 🤖 Generated with Claude Code |
…fixes fix(pentest): address cubic review findings on finding-context flow
|
@cubic-dev-ai review it |
@tofikwest I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
1 issue found across 31 files
Confidence score: 4/5
- In
apps/api/src/security-penetration-tests/finding-context.util.ts, the composedadditionalContextcan grow past the 4000-character contract after stored notes are appended, which could cause downstream validation/rejection or truncated context in consumers; add a hard length cap (and ideally a test for over-limit note sets) before merging to de-risk this path.
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
The provider has no documented limit (verified against its OpenAPI spec and prompt-injection source), but the composed briefing (user context + all stored notes for a target) was unbounded. Cap at 20,000 chars by dropping whole notes — never cutting one mid-sentence — with an explicit '(N more notes omitted for length)' marker so the agent knows the list is incomplete. User-typed context is always kept (DTO-capped at 4000). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Re the latest cubic finding (unbounded
🤖 Generated with Claude Code |
…fixes fix(pentest): cap the composed additionalContext briefing at 20k chars
|
🎉 This PR is included in version 3.79.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This is an automated pull request to release the candidate branch into production, which will trigger a deployment.
It was created by the [Production PR] action.
Summary by cubic
Adds customer context to pentest findings and run-level context. Retests include saved notes in the provider’s
additionalContext, and report downloads append a “Customer context & management responses” appendix in Markdown and PDF.New Features
/v1/pentest-finding-contextsendpointstargetUrl(requirespentest:read)pentest:update), with normalized target validationadditionalContext(max 4000). Service composes provideradditionalContextfrom this plus saved notes for the same normalized target URL; lookup is best‑effort and falls back to caller context on DB errors. Composed briefing is capped at 20,000 chars — drops whole notes with an “(N more notes omitted for length)” marker; user‑typed context is always kept.pentest:update.SecurityPenetrationTestFindingContexttable with indexes; normalized target URL matching. OpenAPI updated.Migration
pentest:update; owners/admins already granted inpackages/auth.additionalContextwhen creating runs.Written for commit c60a1b8. Summary will update on new commits.