Skip to content

πŸ› fix(security): resolve scanner findings - #61

Merged
scttbnsn merged 4 commits into
mainfrom
codex/security-alert-cleanup
Jul 28, 2026
Merged

scttbnsn merged 4 commits into
mainfrom
codex/security-alert-cleanup

Conversation

@scttbnsn

@scttbnsn scttbnsn commented Jul 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • sanitize untrusted values before structured logging across all CodeQL-reported sinks
  • upgrade Next.js, React, js-yaml, postcss, sharp, and related web packages to patched releases
  • add narrowly scoped Grype ignores for verified unreachable x/crypto/openpgp findings
  • refresh generated CSP hashes after the frontend dependency upgrade

Validation

  • go test -race ./...
  • golangci-lint run
  • go build ./cmd/portwing
  • all five fuzz smoke tests
  • govulncheck ./...
  • grype dir:. --config .grype.yaml --fail-on high
  • npm ci
  • npm audit --audit-level=moderate
  • npm run lint
  • npm --workspace website run test:headers
  • npm run build
  • GoReleaser snapshot via pre-push hook

Closes the actionable GitHub Security alerts; Scorecard alert #96 was separately dismissed with evidence because its reported FROM rootfs-${TARGETARCH} line selects a digest-pinned internal stage.

Changelog

  • πŸ”’ Sanitized untrusted values before structured logging across audit, auth, Docker, edge, tunnel, middleware, and adapter paths.
  • ✨ Added applog.Sanitize to escape newline and carriage-return characters, with unit tests.
  • πŸ”§ Upgraded Next.js, React, Tailwind/PostCSS, js-yaml, sharp, and related dependencies.
  • πŸ”’ Added narrowly scoped Grype ignores for unreachable x/crypto/openpgp findings.
  • πŸ”§ Refreshed route-specific CSP script hashes after frontend dependency updates.
  • πŸ› Addressed actionable GitHub Security alerts and validated Go, JavaScript, scanning, lint, build, fuzz, and GoReleaser checks.

Concerns

  • Verify Grype ignores remain valid when x/crypto versions or dependencies change.
  • Confirm regenerated CSP hashes cover every affected route and frontend build output.
  • Ensure dependency lockfiles and override versions remain consistent across packages.

Sanitize untrusted structured log attributes, patch vulnerable web dependencies, scope verified Grype false positives, and refresh generated CSP hashes.
@coderabbitai

coderabbitai Bot commented Jul 28, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@scttbnsn, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 30 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
βš™οΈ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: df227f39-cc67-4e5b-b5cd-0bcbe587d2e0

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 3893ba5 and 2f2a956.

πŸ“’ Files selected for processing (5)
  • .github/workflows/security-grype.yml
  • .grype.yaml
  • internal/server/middleware.go
  • internal/server/middleware_test.go
  • scripts/verify-scanner-exclusions.sh
πŸ“ Walkthrough

Walkthrough

Adds applog.Sanitize, which escapes newline and carriage-return characters, with unit coverage. Applies sanitization to backend error, identifier, request, audit, authentication, middleware, Docker, edge, tunnel, and CLI logs. Updates Grype exceptions for GO-2026-5932, refreshes JavaScript dependencies and overrides, and replaces route-specific CSP script hashes.

πŸš₯ Pre-merge checks | βœ… 2
βœ… Passed checks (2 passed)
Check name Status Explanation
Linked Issues check βœ… Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check βœ… Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
πŸ§ͺ Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/security-alert-cleanup

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❀️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

πŸ€– Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.grype.yaml:
- Around line 1-29: Update the GO-2026-5932 exceptions in the ignore
configuration to use the exact intended go.mod path instead of **/go.mod, and
add CI validation for each affected dependency/binary using govulncheck or
binary-symbol inspection. Fail CI when golang.org/x/crypto/openpgp is imported
or linked, so the ignore remains valid only while usage is limited to the
verified non-openpgp paths; ensure review is triggered by usage changes as well
as version changes.

In `@internal/server/middleware.go`:
- Around line 505-508: Update the Ed25519 authentication flow around
auth.VerifyRequest to reserve the client IP’s verification capacity using the
existing rate-limiter locking path before verification begins. On verification
error, report the failure through that same path rather than calling
rl.RecordFailure afterward, while preserving the existing reason logging.
πŸͺ„ Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
βš™οΈ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 6465aa0e-5c68-43f9-9927-a3179a6ac344

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between bdc1bf6 and 3893ba5.

β›” Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json, !**/package-lock.json
πŸ“’ Files selected for processing (15)
  • .grype.yaml
  • cmd/portwing/main.go
  • docs/package.json
  • internal/adapter/drydock/adapter.go
  • internal/audit/audit.go
  • internal/auth/verify.go
  • internal/docker/client.go
  • internal/edge/client.go
  • internal/edge/tunnel.go
  • internal/log/logger.go
  • internal/log/logger_test.go
  • internal/server/middleware.go
  • package.json
  • website/package.json
  • website/vercel.json

Comment thread .grype.yaml Resolved
Comment thread internal/server/middleware.go Resolved
scttbnsn added 3 commits July 28, 2026 09:39
Reserve Ed25519 verification capacity atomically and guard the scoped OpenPGP scanner exceptions with source and shipped-binary checks.
Scope the Docker Compose compress advisory false positive and fail CI if either excluded vulnerable package becomes imported or linked.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant