Skip to content

fix: pin Trivy action to SHA, accept documented risk for moderate advisories#337

Closed
itsmiso-ai wants to merge 5 commits into
mainfrom
fix/dependency-advisories
Closed

fix: pin Trivy action to SHA, accept documented risk for moderate advisories#337
itsmiso-ai wants to merge 5 commits into
mainfrom
fix/dependency-advisories

Conversation

@itsmiso-ai

Copy link
Copy Markdown
Contributor

Fixes #314

  • Pin aquasecurity/trivy-action to SHA ed142fd (v0.36.0) instead of @master for reproducible CI security scanning
  • Fix .npmrc invalid omit= config (was empty, now omit=dev)
  • Tighten version ranges: next ^16.2.7, prisma ^7.8.0, @prisma/client ^7.8.0
  • Document accepted risk for 5 moderate advisories in SECURITY-ACCEPTED-RISKS.md

Accepted Risks

Two moderate advisories cannot be resolved without major version downgrades:

  1. next → postcss XSS (GHSA-qx2v-qp2m-jg93): Latest stable Next.js (16.2.7) still bundles vulnerable postcss. Fix requires downgrade to next@9.3.3.
  2. prisma → @hono/node-server middleware bypass (GHSA-92pp-h63x-v22m): Only fix is downgrade to prisma@6.19.3.

Both are low-risk in our self-hosted deployment model. See SECURITY-ACCEPTED-RISKS.md for details.

Saffron Worker added 5 commits June 8, 2026 12:06
Extract DB-backed lock from scheduled sync into shared module
(src/lib/sync-lock.ts) and apply it to manual issue sync and automation
sync endpoints. This prevents overlapping concurrent runs across all
three sync types (scheduled, manual, automation), addressing race
conditions from browser refreshes, cron overlap, or repeated clicks.

- New src/lib/sync-lock.ts: acquireLock(syncType) / releaseLock(runId)
  with stale lock cleanup (>30 min) and transactional double-check
- src/app/api/sync/route.ts: acquire lock before issue sync, return 409
  if a sync is already running
- src/app/api/automation/sync/route.ts: acquire lock before automation
  sync (single repo or batch), return 409 if locked
- src/app/api/sync/scheduled/route.ts: replace inline lock with shared
  module import, update error message to be sync-type-agnostic
- prisma/schema.prisma: update syncType comment to include 'automation'
- Add authorizeRequest() to sync/route.ts POST handler for Bearer token auth
- Add authorizeRequest() to webhook/route.ts POST handler
- Make webhook signature verification fail-closed by default
- Introduce WEBHOOK_GATEWAY_MODE=true opt-out for gateway deployments
- Update documentation comments to reflect new security model
Add a new GET /api/issues/untriaged endpoint that surfaces open issues
with no status/* label for grooming intake. This addresses issue #325:

- Returns open issues from enabled repos without any status/ label
- Excludes Renovate/dashboard noise by default (configurable)
- Bounds results per run (default 50, hard cap 200)
- Supports repo filter and excludeRenovate query params
- Not claimable by worker queues — grooming-only view

Includes tests for the new endpoint and updates route smoke checks.
Add .npmrc with 'omit=' to override global npm config that omits
devDependencies by default. This ensures 'npm ci' installs all
dependencies needed for 'npm run typecheck' and 'npm run test'
to work from a clean checkout.
…oderate advisories

- Pin aquasecurity/trivy-action to SHA ed142fd (v0.36.0) instead of @master
  for reproducible CI security scanning
- Fix .npmrc invalid omit config (omit= → omit=dev)
- Tighten version ranges: next ^16.2.7, prisma ^7.8.0, @prisma/client ^7.8.0
- Document accepted risk for 5 moderate advisories in SECURITY-ACCEPTED-RISKS.md
  (next/postcss XSS and prisma/@hono/node-server bypass require major downgrades)
@itsmiso-ai

Copy link
Copy Markdown
Contributor Author

Superseded by #338 which has a clean diff targeting only the dependency advisories fix.

@itsmiso-ai itsmiso-ai closed this Jun 9, 2026
@itsmiso-ai itsmiso-ai deleted the fix/dependency-advisories branch June 9, 2026 13:52
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.

Resolve production dependency advisories

1 participant