Skip to content

Feat/security remediation phased 2026 03#4

Merged
jgleiser merged 5 commits intomainfrom
feat/security-remediation-phased-2026-03
Mar 23, 2026
Merged

Feat/security remediation phased 2026 03#4
jgleiser merged 5 commits intomainfrom
feat/security-remediation-phased-2026-03

Conversation

@jgleiser
Copy link
Owner

Summary

Release 1.3.2 with the full phased security remediation (phases 0, 1, and 2) plus security test alignment.
This includes invitation recipient binding, markdown sanitization in artifact rendering, CSRF protections, centralized upload path config, admin pagination validation hardening, and a CI dependency-audit gate.

Description

This PR finalizes the security-review remediation rollout and prepares the release metadata.

What’s included:

  1. Security hardening delivered across phases 0-2:

  2. Invitation token acceptance is now bound to the intended recipient.

  3. Markdown content in dashboard/admin artifact views is sanitized before DOM rendering.

  4. CSRF defenses were added for state-changing API requests (server middleware + client propagation).

  5. Evidence upload path handling now uses centralized configuration.

  6. Admin user pagination parameters are validated/clamped before querying.

  7. Dependency vulnerability checks are enforced in CI via a security audit workflow.

  8. Test coverage updates:

  9. Added/updated integration and unit security tests for invitation flow, CSRF, evidence constraints, and admin pagination.

  10. Patched app-security nonce expectations to match secured dashboard script behavior.

  11. Release metadata:

  12. Version bumped from 1.3.1 to 1.3.2.

  13. Changelog updated with Added/Changed/Fixed entries for all security remediation work.

@jgleiser jgleiser merged commit 36adea1 into main Mar 23, 2026
2 checks passed
@jgleiser jgleiser deleted the feat/security-remediation-phased-2026-03 branch March 23, 2026 01:09
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5c9b943aed

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +75 to +76
if (!requestOrigin || !allowedOrigins.has(requestOrigin)) {
return res.status(403).json({ error: 'Invalid request origin' });

Choose a reason for hiding this comment

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

P2 Badge Permit CSRF validation when Origin header is absent

This rejects all mutating /api requests that lack both Origin and Referer, even when the request includes a valid auth cookie and matching x-csrf-token. Non-browser clients (CLI scripts, server-side automation, webhook relays) commonly omit those headers, so this change introduces a backwards-incompatible 403 path for previously valid API calls. At minimum, this should be configurable or allow token-matched requests when origin metadata is unavailable.

Useful? React with 👍 / 👎.

return next();
}

if (!req.path.startsWith('/api') || CSRF_EXEMPT_PATHS.has(req.path)) {

Choose a reason for hiding this comment

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

P2 Badge Normalize exempt auth paths before CSRF path matching

CSRF exemptions are checked with exact string equality, so /api/auth/login/ and /api/auth/register/ are not exempt even though the app does not enable strict routing and Express will route those trailing-slash URLs to the same handlers. In that case, login/registration requests are incorrectly forced through CSRF token checks and can fail with 403, which is an avoidable regression for clients/frameworks that append trailing slashes.

Useful? React with 👍 / 👎.

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