Skip to content

Additional security fixes - #257

Merged
rthellend merged 38 commits into
mainfrom
review-2026-10-14
Oct 16, 2026
Merged

rthellend merged 38 commits into
mainfrom
review-2026-10-14

Conversation

@rthellend

Copy link
Copy Markdown
Collaborator

Description

This release fixes additional security and reliability issues found during a follow-up review. See CHANGELOG.md

Type of change

  • New feature
  • Feature improvement
  • Bug fix
  • Documentation
  • Cleanup / refactoring
  • Other (please explain)

How is this change tested ?

  • Unit tests
  • Manual tests (explain)
  • Tests are not needed

…ertMatches group check, and QUIC IP/ALPN checks
…ver, and URL validation in examples/deviceauth
rthellend and others added 8 commits October 14, 2026 21:08
… and GET parsing, CA re-issue logging, and cleanups

Fixes from the review of the branch:

* enforceSSOPolicy: when no SSO rule matches a scoped local handler, use a
  default rule so unauthenticated users go through the login flow instead
  of getting a bare 403.
* ocspcache: give responses without NextUpdate a NextUpdate of
  ThisUpdate+24h so they can be cached and served from the cache.
* pki: fix GET OCSP parsing for ocspServers URLs without a path, and use
  the longest matching prefix.
* pki: when the CA certificate is re-issued to add the CRLSign key usage,
  log the old and new fingerprints and replace the old entry in the list
  of issued certificates instead of appending.
* backend.close(nil): close document roots after the HTTP server is
  closed, not while requests may still be using them.
* netw: use atomic pointers for limiters and upstream counters instead of
  taking a mutex on every Read/Write.
* Remove dead code: jwks.Remote.GetKeyForIssuer and
  TokenManager.IssuerForKey. Keep validateRemotePublicKey until the jwks
  module dependency is updated to include the same checks.
* Clean Connection headers before any header injection, removing the
  set-strip-set pattern for X-tlsproxy-user-id.
* Add setNoFrameHeaders and apply it to all local handlers.
* Reject rewriteRules with reserved output claims at config validation.
* ManageKeys: single guard for a missing passkey_hash.

Behavior changes reverted after evaluation:

* Do not clear req.URL.RawPath on path sanitization (broke encoded-slash
  APIs).
* Do not escape '/' in X-Forwarded-Client-Cert Subject values.
* Do not skip group-named ACL entries in certMatches.
* Accept RSA public exponents >= 3 in PKI CSRs.

Tests: add coverage for OCSP caching without NextUpdate, path-less OCSP
URLs, RSA e=3 CSRs, reserved rewrite-rule claims, and XFCC on HTTP over
raw QUIC streams. Fix CHANGELOG descriptions.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ok up local PKIs by all issued key IDs

Go 1.25 changed the default SubjectKeyId derivation in CreateCertificate
from SHA-1 to SHA-256 (GODEBUG x509sha256skid). A CA certificate created
with an older Go and re-issued now (for the CRLSign key usage, or at half
of its lifetime) got a different SubjectKeyId, while the AuthorityKeyId
of all previously issued certificates still had the old value. The
proxy's pkiMap lookup, keyed by SubjectKeyId, then missed, and client
certificates issued by the local PKI were checked through OCSP on every
handshake instead of the local revocation list, producing
"INF OCSP: ... is GOOD" log entries.

* initCA: copy the SubjectKeyId of the existing CA certificate into the
  new one. The key doesn't change, so the identifier shouldn't either.
* Add PKIManager.KeyIDs(), which returns the CA's SubjectKeyId and the
  distinct AuthorityKeyIds of all issued certificates, and register the
  PKI in pkiMap under all of them. This also heals deployments whose CA
  certificate was already re-issued with a different SubjectKeyId.
* Add TestCAReissuePreservesSubjectKeyId.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
reAuthorize is called both directly by the test and by the goroutine
that Reconfigure starts, so Close() runs concurrently. Use atomic.Bool.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@rthellend
rthellend merged commit b32dbbe into main Oct 16, 2026
1 check passed
@rthellend
rthellend deleted the review-2026-10-14 branch October 16, 2026 14: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.

1 participant