Repository navigation
Socrate v1.14.6
Security patch release on the v1.x line. The token-exchange grant (only active with the
non-default TOKEN_EXCHANGE_MODE=enforce) authenticates the client first and accepts only active,
confidential clients, checks the presented tokens like the refresh grant, and targets only the
client's registered audiences with an actor that belongs to the requesting client. Email header
values can no longer carry a line break; chi and x/crypto move past two advisories that Socrate's
code does not reach; numeric ids are parsed at the platform's integer size; CI actions and base
images are pinned. No migration, no environment variable, no change of default; with
TOKEN_EXCHANGE_MODE=off (the default) the token endpoint behaves as in v1.14.5.
Security
-
Token exchange authenticates the client first, and only an active, confidential client may
exchange. WithTOKEN_EXCHANGE_MODE=enforce(defaultoff), the token-exchange grant now
checks the requesting client before it looks at any presented token: a client without a secret
(a public client) is refused with403 unauthorized_clienteven when it has
allow_token_exchange, a wrong or missing secret with401 invalid_client, a deactivated
client with400 unauthorized_client, and a client registered withrequire_dpopwithout a
DPoP proof with400 invalid_dpop_proof, as on the other grants. Before, a public client was
never authenticated and the deactivation and DPoP checks were not applied, and the subject token
was verified before the client. The audit row records the refusal (deny_reason
public_client,invalid_client,inactive_clientordpop_required). Inshadowmode
every refusal still answersunsupported_grant_type. Deploy note: no migration, no environment
variable, no change of default; a public client that hadallow_token_exchangemust become a
confidential client to keep exchanging. -
Token exchange checks the presented tokens like the refresh grant. With
TOKEN_EXCHANGE_MODE=enforce(defaultoff), a subject or actor token is now refused
(400 invalid_grant) when itsjtiis on the used/revoked list (a rotated refresh token, a
revoked access token) or the list cannot be read, when it is DPoP-bound (cnf.jkt) and the
request carries no proof for that key, when the user's tokens were revoked after it was issued
(token version), or when its user is locked or unknown. Before, only its signature, type and
expiry were checked. The audit row names the check (deny_reasonsubject_revoked,
subject_dpop_mismatch,subject_token_version,subject_locked,subject_unknown_user, or
the same withactor_). An ID token is no longer accepted as a subject or actor token
(…_id_token): it carries no token version, so revoking the user's tokens would not reach it. A service-account token (aclient_credentialstoken,subapp:<id>), such as a
service's own token used as the actor of a delegation, has no user: it is accepted while its app
exists and is active (deny_reason…_unknown_app/…_inactive_appotherwise), and the
revocation and DPoP checks apply to it too. Deploy note: no migration, no environment variable, no change of default. -
Token exchange targets only the client's registered audiences, and the actor must be the
requesting client. WithTOKEN_EXCHANGE_MODE=enforce(defaultoff), each requested
audienceandresourcemust be one of the client's registeredaudiences(set by an
operator in the admin console), otherwise400 invalid_target; the exchanged token'saudis
the requested audiences and resources together (aresource-only request used to yield a token
withoutaud). In a delegation, the actor token must belong to the requesting client — issued
to it (aud[0]is itsclient_id) or its own service-account token — otherwise
400 invalid_grant(deny_reasonactor_not_requesting_client). Before, any audience string
was accepted and any valid token could act as the actor. Deploy note: no migration, no
environment variable, no change of default; a client that exchanges tokens must have its
target audiences registered. -
Email header values cannot carry a line break. Outgoing emails are built so that no header
takes a raw line break from its input: the recipient must be a single valid address
(net/mail), the sender's display name is encoded, and the subject (which includes the
application name) becomes a MIME encoded-word (RFC 2047) when it holds a control or non-ASCII
character, which also makes non-ASCII application names display correctly. An email to an
invalid address is refused instead of being sent. No migration, no environment variable. -
Dependencies:
github.com/go-chi/chi/v55.3.2 → 5.5.0 (GHSA-j6qf-3m9c-vwj3, client IP from
X-Forwarded-Forin chi'sClientIPFromXFF) andgolang.org/x/crypto0.57.0 → 0.59.0
(GO-2026-5932, the deprecatedopenpgppackage), withx/sync,x/sysandx/textfollowing.
Socrate uses neither affected code path (client IPs come from its ownClientIPmiddleware since
P3-2, and nothing importsopenpgp; govulncheck reported neither as reachable); the bump closes
OpenSSF Scorecard's Vulnerabilities alert. No code change; rebuild to pick it up.
Changed
-
Numeric ids read from URLs, query strings and token subjects are parsed at the platform's
integer size (strconv.IntSize) before they become auint, so an id too large foruintis
refused instead of wrapping on a 32-bit build. No change on the 64-bit builds Socrate ships;
closes CodeQL's "incorrect conversion between integer types" alerts. -
CI and image supply chain: every GitHub Action is pinned to a commit SHA (the tag kept as a
comment) and bothDockerfilebase images to a digest, so a moved tag cannot change what CI or
the image build runs; Dependabot (already configured forgithub-actionsanddocker) keeps
the pins current. TheReleaseworkflow is read-only by default and only its release job may
write. Closes OpenSSF Scorecard's Pinned-Dependencies and Token-Permissions alerts. No change to
the server. -
Tests: the TOTP single-use tests (#374) fail on every database or lookup error instead of
ignoring it, andscratchDBgets its doc comment back. No runtime change. -
Tests:
TestPostgresRateLimitStore_WindowsAreSeparateno longer fails during the first minute
of every hour (when a 1-minute and a 1-hour window both start at hh:00:00). The Postgres
rate-limit store reads its clock through a field that the test pins. No runtime change.