Repository navigation
Releases
Socrate v1.16.2
Patch release on the v1.x line for step-up sign-in. max_age on /oauth/authorize can be
met, 0 included (it always ended in login_required before), and a new control, off by
default, makes acr_values=mfa require a second-factor sign-in (ACR_VALUES_MODE). No
migration, no change of default, no change to discovery or claims.
Upgrade notes
- Client-facing changes: a request with
max_agethat ended inlogin_requiredafter a fresh
sign-in on the login page now gets a code; underACR_VALUES_MODE=enforceonly, the new error
unmet_authentication_requirements. - acr_values: run
ACR_VALUES_MODE=observeand look foracr_values_unmetevents before
enforce; a user without MFA turned on cannot meetacr_values=mfa. Clients must still check
acr/amrin the token (bff.StepUp.Satisfied, backendkit v1.29.0).
Fixed
max_ageon/oauth/authorizecan be met,0included. The check ran when the user clicked
Allow on the consent page, measuring the time since the sign-in:max_age=0therefore always
ended withlogin_required(re-authentication required), and a smallmax_agedid whenever
the consent page stayed open a few seconds, so a client could not ask for a step-up sign-in
with it. A sign-in on the login page of the same request is the active re-authentication OIDC
Core §3.1.2.1 asks for, and now meets anymax_age; an earlier sign-in is checked as before.
The tokens carry that sign-in'sauth_time,amrandacr. Client-facing change: a request
withmax_agethat ended inlogin_requiredafter a fresh sign-in now gets a code.
Added
acr_values=mfacan require a second-factor sign-in (ACR_VALUES_MODE, defaultoff). A
client asking for a step-up sign-in before a sensitive action could not require a second factor:
acr_valueswas ignored, although discovery advertisesacr_values_supported
["pwd","mfa"]. Underenforce, a request whoseacr_valuesnamesmfa(and notpwd) gets a
code only for a sign-in with a second factor, and otherwise the error
unmet_authentication_requirements(OpenID Connect Unmet Authentication Requirements 1.0);
observeissues the code and auditsacr_values_unmet;offchanges nothing.acr_values
is carried through the login and consent pages and bound into the consent token. Client-facing
change: the new error code, only underenforce. The client must still checkacr/amrin the
token (asbff.StepUp.Satisfieddoes):acr_valuespasses through the browser like every
authorization parameter, so a user can drop it. Deploy note: a user without MFA turned on
cannot meetacr_values=mfa; runobservefirst.
Documentation
- The production env template lists every opt-in control.
deploy/env/socrate.env.example
gainsMFA_RECOVERY_CODES_REVERIFY_MODE(v1.16.1),AUDIT_INTEGRITY_SCAN_INTERVAL_SECONDSand
_LOOKBACK_SECONDS, andADMIN_PASSWORD_LOGIN_ENABLED, each commented out at its default; it
now matches the monitoring deploy kit's copy. No behaviour change.
Socrate v1.16.1
Security patch release on the v1.x line. It closes what was left of the v1.14.2 audit: turning
MFA off and replacing the recovery codes are re-proved and count toward the lockout, the attempt
that locks an account no longer reveals that it exists, token exchange never yields an
operator-console token, and revoke and logout check a DPoP-bound token's proof. One migration,
one new control (off by default, MFA_RECOVERY_CODES_REVERIFY_MODE), no change to discovery
or claims.
Upgrade notes
- Migration 0038 (
AUTO_MIGRATE=false: run it deliberately, after a backup). It drops the
foreign key onadmin_logs.app_idand rewrites no data. - Client-facing changes:
- the sign-in attempt that locks an account answers
401 invalid_credentialsinstead of403
account locked; POST /api/profile/mfa/confirmanswers200with the firstrecovery_codesinstead of
204;- the
/api/profile/mfaposts are rate-limited per user (429); POST /api/profile/mfa/disableanswers403once the account is locked.
- the sign-in attempt that locks an account answers
- Recovery codes: deploy the admin console v1.7.4 (it sends the password and a code, and takes
confirm's codes), then runMFA_RECOVERY_CODES_REVERIFY_MODE=observeand look for
mfa_recovery_codes_reverifyevents withwould_refuse_missingbeforeenforce. - Token exchange and DPoP changes apply only with
TOKEN_EXCHANGE_MODEorDPOP_MODEon.
An existing public client withallow_token_exchangekeeps it, inert; turning it on for one is
refused (400).
Security
-
Replacing the MFA recovery codes can require the password and a code
(MFA_RECOVERY_CODES_REVERIFY_MODE, defaultoff).POST /api/profile/mfa/recovery-codes
hands out a fresh set of recovery codes, a second factor, to whoever holds the user's access
token. Underenforceit needs{"password","code"}, checked as for MFA disable (each wrong
one counts toward the lockout;400without them,401when wrong,403once locked);
observeallows and auditsmfa_recovery_codes_reverifywith whether the request carried
them;offchanges nothing. So that turning MFA on still gives the first codes,POST /api/profile/mfa/confirmnow answers200with them (recovery_codes) instead of204: the
code just used cannot be used again. Client-facing change: confirm's new body; a client that
ignores it and asks for codes afterwards still works unless the mode isenforce. Deploy note:
upgrade the admin console (which sends the password and code, and takes confirm's codes)
before settingobserveorenforce. The hosted account page, behind its fresh sign-in, is
unchanged. -
Turning MFA off counts failed attempts toward the account lockout, and the MFA routes are
rate-limited.POST /api/profile/mfa/disablechecked the password and the code without
counting failures and had no rate limit, so whoever held a user's access token and password
could try codes without limit and switch the second factor off; the hosted account page's
disable step did not count a wrong code either. Both now go through the auth service's new
ReverifyForMFAChange, which uses the sign-in checks (checkPasswordWithLockout,stepUpMFA):
each wrong password or code counts, and a locked account is refused (403) before anything is
checked. The/api/profile/mfaposts are rate-limited per user with the login limiter (429).
Closes the gap the v1.14.2 audit's H-2 fix left on this route. No new setting. -
The attempt that locks an account no longer reveals that it exists. The wrong password that
reached the lockout limit was answered403account locked, an answer an unknown email never
gets, so a few wrong passwords told whether an email names an account. That attempt is now
answered401invalid credentials, like any wrong password; the account is still locked and
the lock audited (account_locked), and, as since
v1.15.0, only the right password then gets403account locked. With
LOCKOUT_SOURCE_MODE=enforcethe same holds for the source lock. A wrong MFA code that locks
the account still answers403: whoever sent it has passed the password check. Client-facing
change: the locking attempt's status moves from403to401; a client that showed "account
locked" on it shows "invalid credentials" until the next attempt with the right password. -
Token exchange hardening (only with
TOKEN_EXCHANGE_MODEshadoworenforce; the v1.14.2
audit's T-1 and T-3 leftovers):- an exchanged token never targets an operator console (
OPERATOR_CONSOLE_CLIENT_IDS,
ADMIN_CONSOLE_CLIENT_ID) or Socrate's admin portal, even one registered as the client's
audience: it would be an admin-API credential (invalid_target, audited
deny_reason: console_audience); - the token-issuance hooks (
hooks.OnBeforeTokenIssue) now run on an exchange too, with grant
token_exchange, and can veto it as any other grant; - a client without a secret can no longer be given
allow_token_exchange(400on create, or
on an update that turns it on): the exchange authenticates the client, so it could never use
it. An existing public client that has it keeps it, inert, and can still be updated otherwise; - a hook's veto on an exchange answers
403 access_denied, as on the other grants.
- an exchanged token never targets an operator console (
-
/oauth/revokeand/oauth/logoutcheck a DPoP-bound token's proof (DPOP_MODE, default
off; the v1.14.2 audit's G-4 follow-up). Their optional bearer identity was read without the
binding check, so a stolen bound token, used as a plain bearer token, could log its user out
(revoking their tokens) or name them to/oauth/revoke. They now use
OptionalAuthMiddlewareWithDPoP: underenforcesuch a token is ignored and the request is
handled as anonymous; underobservethe failure is logged and the token accepted; under
offnothing changes. They also accept theDPoPscheme when binding is on.
Fixed
-
cmd/seed -forceends earlier password-reset links. Resetting the superadmin with
-forceset a new password without recording when, so a reset link issued before it stayed
valid; it now setspassword_changed_at, as every other password change does (the v1.14.2
audit's #366 follow-up). The account page's sign-in is also covered by the every-path lockout
test. -
Deleting an app keeps its admin-log rows'
app_id(migration 0038, #260 follow-up). The
foreign key fromadmin_logs.app_idtoappsmade app deletion null that column, so the admin
log lost which app an action concerned. Migration 0038 drops every foreign key on it, as 0036
did for the security audit log; the model no longer declares one (constraint:-), and app
deletion leaves the rows as they are. Deploy note: migration 0038 runs on start; it drops a
constraint only and rewrites no data. Rows nulled by earlier deletions stay null.
Socrate v1.16.0
Feature release on the v1.x line. The monitoring alert rules, stored until now but never
evaluated, are evaluated under a new mode, and a fresh install starts with a recommended set of
them; a redirect URI can be required to match its registration exactly. Both controls ship
off (ALERT_RULES_MODE, REDIRECT_URI_MATCH_MODE). One migration, no change of default, no
change to discovery, claims or error codes.
Upgrade notes
- Migration 0037 (
AUTO_MIGRATE=false: run it deliberately, after a backup). It adds the seven
default alert rules only ifalert_rulesis empty, touches no other table and rewrites no data;
on a fresh install it createsalert_rules. - Alert rules: nothing is evaluated until
ALERT_RULES_MODEis set. Runobserve, read the
alert history in the monitoring console (v1.3.0 shows the mode on its Alerts page), add
recipients or a webhook URL to the rules you keep, thenenforce. Email needs SMTP configured. - Exact redirect URIs: run
REDIRECT_URI_MATCH_MODE=observeand look for
redirect_uri_inexact_matchevents (the consoles' callbacks included) beforeenforce.
Added
- Alert rules are evaluated (
ALERT_RULES_MODE, defaultoff, #258). Rules could be created in
the monitoring console, but nothing evaluated them, so no alert was ever raised. Underobserve,
everyALERT_RULES_INTERVAL_SECONDS(default 60) each enabled rule counts its event type in its
window, per group of itsgroup_by; a group that reaches the threshold records a triggered
alert (alert history, analert_triggeredsecurity event), once per group and window.enforce
also sends the rule's notifications: email to its recipients (needs SMTP), its alert as JSON to
itswebhook_url, or a Slack message, overhttpsto a public address through the SSRF guard.
Each alert records the outcome of each notification. With several instances, one evaluates at a
time.GET /api/admin/alerts/rulesreports the mode asevaluation_mode.docs/ALERT-RULES.md
no longer documents actions, severities and a condition field that never existed (log,
block_ip,high/medium/low/info,match_value). Deploy note: new variables
ALERT_RULES_MODE(defaultoff) andALERT_RULES_INTERVAL_SECONDS; runobservefirst and
read the alert history beforeenforce. - Default alert rules (migration 0037). A fresh install, or a server upgraded without any rule,
starts with seven: brute force from one IP, account under attack, account locked, refresh token
reused, revoked token still in use, client secret guessing, audit log tampering. Each watches an
event the server records, is enabled and notifies by email, with no recipient until one is added;
nothing is evaluated untilALERT_RULES_MODEis set. A server that already has rules keeps only
its own.docs/ALERT-RULES.mdlists them, lists the event types never recorded (a rule on them
never triggers), and its examples no longer userate_limit_exceededor
brute_force_detected. Deploy note: migration 0037 runs on start; it adds rows only to an empty
alert_rules, writes fixed SQL, and touches no other table (on a fresh install it creates
alert_rules, whose foreign key AutoMigrate adds).
Security
- A redirect URI can be required to match its registration exactly (
REDIRECT_URI_MATCH_MODE,
defaultoff). Redirect URIs were compared after normalization (case of scheme and host, default
port, trailing slash, query order): safe, but more lenient than the exact string comparison RFC
9700 §2.1 recommends.observeauditsredirect_uri_inexact_matchat code issuance when only
the normalized form matched (the client and the URI it sent);enforcerefuses it as not
registered, and audits the refusal: on the authorization page (before sign-in), at code issuance
and forpost_logout_redirect_uri.docs/API.mdno longer says the match was exact. Deploy
note: new variableREDIRECT_URI_MATCH_MODE, defaultoff; runobserveand fix the
registrations or clients it names beforeenforce(#261).
Socrate v1.15.0
Security release on the v1.x line. It closes the findings of the November 2026 review: account
and session state that a concurrent save could undo, controls that failed open when the database
erred, a locked account that revealed itself, consent and code-exchange gaps, client-IP attribution
behind appending proxies, timing that told which client_ids exist, and app deletion breaking the
audit log's integrity. Several controls are new and ship off (LOCKOUT_SOURCE_MODE,
PRIVILEGED_SCOPE_MODE, SERVICE_USER_SCOPE_MODE, CODE_REPLAY_MODE), and existing modes cover
more routes. Four migrations, no change of default, no change to discovery, claims or error codes.
Upgrade notes
- Migrations 0033–0036 (
AUTO_MIGRATE=false: run them deliberately, after a backup). 0033 adds
audit_chain_head(the server anchors it on the existing log at startup), 0034 adds
login_source_failures, 0035 adds two nullable columns and an index toauthorization_codes,
0036 drops the foreign key fromsecurity_audit_logs.app_idtoapps. None rewrites data; all
work on a fresh install. Audit rows whoseapp_idan earlier app deletion nulled keep failing
the integrity scan: their attribution cannot be restored. - Before deploying, check that no client relies on omitting PKCE without a secret — this must
return nothing, or those clients must send acode_challenge:
SELECT client_id FROM apps WHERE NOT is_public AND coalesce(client_secret_hash, '') = ''; - Applications calling the policy decision point about a global admin who is not a member of
the app must send the admin's token, not a bareuser_id(backendkit'spepalready does). - More than one proxy hop in front of Socrate: list every hop in
TRUSTED_PROXIES(the client
is now the right-most entry not listed). The deploy kit's single Caddy is unaffected. - Users re-authenticate once if they had a consent page open during the upgrade, or a browser
holding the admin console's old refresh cookie. - A wrong password on a locked account now gets
401like any wrong password, not403. - Stored A4 policies (
POLICY_MODEshadow/enforce): add theapp-adminsrule and the new
step-up actions todestructive-step-up(seedocs/EXTENSIBILITY.md); withPOLICY_MODE=off,
the default, nothing changes. - New modes are off by default; run each in
observeand read its audit events before
enforce.
Security
-
Deleting an app no longer rewrites its audit rows. The audit log's
app_idhad a foreign key
toapps, so deleting an app first setapp_idto null on every audit row naming it: the rows
lost their attribution and,app_idbeing covered by each row's hash, the integrity scan reported
them as tampered. Theclient_deletedevent, written after the delete, was refused by the same
key and lost. The foreign key is dropped (migration 0036; the model no longer declares it): an
app's audit rows keep naming it, still verify, and its deletion is recorded. Deploy note:
migration 0036 drops one constraint and rewrites no data (#260). -
Client authentication takes the same time whether the client exists or not. The token
endpoint (every grant, and the token exchange), introspection and revocation answered an unknown
client_idwithout checking any secret, a public client against no hash, and an inactive client
before its secret, while a known confidential client paid a bcrypt check (cost 12, about 250
ms): the response time told which client_ids exist. Those cases now pay a check of the same cost
against a fixed placeholder hash (computed at startup, before the server serves), and so does a
client whose secret is still a legacy SHA-256 hash. The token exchange already authenticated the
client before examining the subject token. Deploy note: none (#366). -
A client without a stored secret must use PKCE, and one rule decides who is confidential.
The token endpoint required a secret from any client with a stored hash and none from the
others, but PKCE was required only of clients flagged public: a client not flagged public and
stored without a secret (legacy data) could redeem a code with neither.App.IsConfidential,
which had no caller, is now that one rule (a stored secret, always required) and is used by the
token endpoint and the token exchange;PKCERequiredalso holds for every client that is not
confidential. Unused helpers that could drift from it are removed (App.HasRedirectURI,
ValidateRedirectURILoose/Strict,CodeStore.GetCode). Deploy note: before deploying, check
that no such client relies on omitting PKCE —SELECT client_id FROM apps WHERE NOT is_public AND coalesce(client_secret_hash, '') = '';should return nothing, or those clients must send a
code_challenge(#366). -
The consent step acts only on the request it was shown for, and honours
prompt=login. The
consent POST took the authorization parameters from the submitted form, so a form edited after
the consent page was rendered could change the scope, the PKCE challenge, the nonce or drop
max_age, andprompt=loginwas checked only when the page was shown. The consent token now
carries a digest of the request it was issued for (client, response type,redirect_uri,
scope, state, nonce, PKCE challenge,max_age,prompt=login); a form that differs, or a token
without one, is refused.prompt=loginis carried through the login and consent forms, and the
consent step answerslogin_requiredunless the sign-in happened on the login form. Deploy
note: a consent page open during the upgrade asks to sign in again (#366). -
The client IP is the right-most untrusted
X-Forwarded-Forentry. Behind a trusted proxy,
the left-most entry was taken as the client, but a proxy that appends to the header (nginx's
$proxy_add_x_forwarded_for, Caddy withtrusted_proxies) keeps whatever the client sent
there, so a client could choose the address that rate limiting, IP blocks, auto-defense and the
audit log saw. The header is now read from the right: the client is the last entry that is not
inTRUSTED_PROXIES(an entry with a port counts as its address), and an empty or malformed
entry ends the walk. The deploy kit's Caddy replaces the
header, so its attribution does not change. Deploy note: a deployment with more than one proxy
hop must list them all inTRUSTED_PROXIES(#366). -
A replayed authorization code can revoke the tokens it was redeemed for (
CODE_REPLAY_MODE,
defaultoff). A code presented again after its redemption was refused, but the tokens issued
for it stayed valid, although the replay means someone else holds the code (RFC 6749 §4.1.2).
The code now records, with its redemption, the refresh-token family and the access-tokenjti
it was redeemed for (migration 0035).observeaudits a replay asauth_code_failedwith
reason: code_replayed;enforcealso revokes that family (every refresh token rotated from
it) and that access token, as seen by introspection, userinfo and the admin API (a resource
server that only verifies the JWT accepts it until it expires) — when the replay authenticates
as the code's client (its secret, or for a public client the code's PKCE verifier), so that
whoever merely saw a used code cannot end the sign-in (revoked: none_unauthenticated), nor
erase the code before its client replays it. A used code is recognised as a replay even after
it has expired, or when it loses a race with its own redemption, and while a replay mode is on a
redeemed code is kept as long as its refresh-token family can be refreshed (the refresh-token
TTL, extended at each rotation), so the expiry sweep does not erase it; underenforcea
refresh whose code cannot be kept is refused (server_error, the old refresh token stays good
to retry with), underobserveit is only logged. An authenticated replay
signals once, unless the revocation could not be recorded (revoked: failed): the code is then
kept, so the next replay tries again; codes redeemed before the migration are audited only. Deploy note: migration 0035
(two nullable columns and an index); new variableCODE_REPLAY_MODE, defaultoff; with it
on,authorization_codeskeeps one row per active sign-in, and each refresh updates it (#366). -
A sign-in records its time without saving the whole user. Hosted login, admin login,
invite acceptance and magic-link sign-in loaded the user, checked the password (and MFA), then
saved the whole row withUserRepository.Updateonly to record the last-login time, writing
back every columnUpdatedoes not guard (the password, token-version and lockout columns
are guarded) from the copy loaded before the checks. A change made to the account in between was undone: an MFA enrolment confirmed while
a sign-in was in flight was switched off again (or an MFA reset restored the old secret), and a
rename or email change was reverted. These paths now use the newUserRepository.RecordLogin,
which writes onlylast_login(andlast_login_attemptwhere the path set it) and
updated_at; a failure to record it stays non-fatal, as before. Deploy note: no migration, no
environment variable, no contract change. -
The decide endpoint no longer reveals who the global admins are. By a bare
user_id, a
subject who is not a member of the calling application got404 unknown subjectunless they
were a global admin, whose decision was evaluated (200), so any application could test user
ids for admin rights. A global admin's implicit access now needs the admin's own token (which
backendkit'spepalways sends); by id they are a404like any non-member. The admin
namespace reservation also matched only an upper-case method:get /api/admin/…and other
spellings an admin rule's glob matches are now refused too (400). Deploy...
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.
Socrate v1.14.5
Security patch release on the v1.x line, hardening the second factor. A wrong TOTP or
recovery code now counts toward the account lockout like a wrong password, and a TOTP code is
accepted only once (migration 0032, a NOT NULL DEFAULT 0 column added on startup). No
environment variable, no change of default, no token-contract change.
Security
-
A TOTP code is accepted once. The time step of the last TOTP code accepted for a user is
stored (users.mfa_last_step, migration 0032), and a code of that step or an earlier one is
refused as a wrong code, on sign-in and on enrollment confirmation (so the code that confirmed
the enrollment cannot then sign in). The step is recorded with a conditional update, so two
requests with the same code cannot both pass, and a full-row save of the user does not move it
back. Recovery codes are unchanged (already single-use). Deploy note: migration 0032 adds a
NOT NULL DEFAULT 0column and runs on startup; no environment variable, no change of default. -
A wrong second-factor code counts toward the account lockout. On every sign-in path that
asks for a TOTP or recovery code after the password (POST /api/auth/login, the hosted login
form, the hosted account page,POST /api/admin/loginandPOST /api/admin/elevate), a wrong
code now increments the same per-account failed-attempt counter as a wrong password, and the
account is locked for the lockout duration when the counter reaches the limit (an
account_lockedevent with reasonmfa_invalid). A locked account is refused before any code
is checked, on/api/admin/elevatetoo, which now answers403 account is lockedlike the
login endpoints. A missing code, a valid code, a redeemed recovery code and a failure to check
the code (e.g. a storage error) do not count; a complete sign-in still resets the counter.
Deploy note: no migration, no environment variable, no change of default (the existing limit
and lockout duration apply).
Socrate v1.14.4
Security patch release on the v1.x line. GET /oauth/authorize is a browser endpoint and now
ignores an Authorization header: it always shows the hosted login page, then the consent page,
and prompt=none always answers login_required. Browser flows are unchanged. No migration, no
environment variable, no change of default; discovery, claims and token endpoints are unchanged.
Security
GET /oauth/authorizeignores anAuthorizationheader. The endpoint is a browser
endpoint: it now always answers with the hosted login page, followed by the consent page, and
no longer treats a bearer access token on the request as a signed-in browser (which skipped the
login page and went straight to consent).prompt=nonetherefore always redirects with
login_required(a request with a bearer token used to getconsent_required). Browser flows
are unchanged, as browsers do not send anAuthorizationheader on a navigation; the consoles,
backendkit and the demo app only redirect browsers there. Deploy note: no migration, no
environment variable, no change of default.
Socrate v1.14.3
Security patch release on the v1.x line. An invite now only activates a pending account
created for the same app (migration 0031, a nullable column added on startup), and the server
is built with Go 1.27.4, which fixes two standard-library vulnerabilities reachable from
Socrate's code. No environment variable, no change of default, no token-contract change. Upgrade
by rebuilding and redeploying; the migration runs on startup.
Security
-
Built with Go 1.27.4 (
go 1.27.4,golang:1.27.4-alpine). Go 1.27.3 and 1.27.4 fix two
standard-library vulnerabilities that govulncheck finds reachable from Socrate's code:
GO-2026-6859 innet/http(fixed in 1.27.4) and GO-2026-6809 incrypto/x509(fixed in
1.27.3). The server binary links the standard library, so a Socrate built with 1.27.2 carries
them: rebuild and redeploy. No code change. -
An invite only activates a pending account created for the same app. A pending account now
records the app whose invite created it (users.invite_app_id, migration 0031), and
POST /api/auth/invite(and the hosted invite page) activates an existing pending account only
with an invite of that app; any other invite gets the existing409answer for an account that
is already in use, and aninvite_acceptedaudit event withsuccess=falseand reason
invite_other_app; a refused invite is not consumed. A pending account created before the
migration falls back to the app of its oldest role; one with no recorded app and no role (e.g.
created by an administrator) is claimed by the first app that adds it. An app adding (through
POST /api/apps/{app_id}/usersor/service/users) a pending account created by another app's
invite still assigns the role, but receives noinvite_tokenand sends no invite email: the
person activates the account through their original invite. New addresses, active accounts and
an app re-adding its own pending account are unchanged. Deploy note: migration 0031 adds a
nullable column and runs on startup; no environment variable, no change of default.
Socrate v1.14.2
Patch release on the v1.x line: documentation and deploy tooling, no server code change. The
release kit gains the one-time VPS preparation script socrate-vps-prep.sh that the installer
expects; the README, the API reference (token exchange, DPoP, conditional discovery values,
loopback admin port), the deploy and env templates, the OP contract and the VPS runbook catch up
with the code; PostgreSQL 16 is the only supported version. No migration, no environment variable,
no change of default, no token-contract change; the binary behaves exactly as v1.14.1.
Added
deploy/release-kit/socrate-vps-prep.sh: the one-time VPS preparation that
socrate-vps-install.shexpects, which was missing from the kit, so a fresh host could not
follow it. On Ubuntu 22.04/24.04, as root (dry run by default,--applyto change): installs
PostgreSQL 16 (PGDG on 22.04) and Caddy; creates thesocrate,socrate-admin-bffand
socrate-mon-bffusers, the directories, thesocraterole and database, and the three env
files (ports 8080/8082/8090/8092, secrets generated on the host and never printed, the console
clients left as the placeholder the installer replaces when it registers them); writes
/usr/local/sbin/socrate-backup.sh(the runbook'sdone: OK ... migrations=<n>, with a daily
cron) and the Caddy sites in the formsocrate-caddy-update.shedits. Idempotent: nothing
that exists is overwritten. ufw only with--firewall, SSH allowed first.socrate-release.sh
ships it next to the installer and the runbook gains a "new VPS only" step;
test-vps-prep.shruns it in CI against a fake root with stub system commands. No server
change, no migration, no environment variable.
Documentation
- Docs brought up to date with the code. README (features: policy decision point, webhooks,
admin confinement modes,prompt, per-client TTL; limitations; backendkit v1.26.1; PostgreSQL 16 only, also in the VPS runbook and test configuration;
migrations0001–0030),.env.example(noJWT_SECRET; token rate limit,_MSwindows,
FROM_NAME, GeoIP,AUTO_MIGRATE), the deploy env template (remaining opt-in modes),
docs/API.md(token exchange, DPoP, conditional discovery values, loopback admin port,
endpoint index), the OP contract and its prompt copy,ALERT-RULES.md(/alerts/history), the
deploy README (migrations, container bind), test strategy and runbook. No code change.
Socrate v1.14.1
Patch release on the v1.x line: the client_updated security event now records a change of a
client's claim_mappings, with the old and new policy, like allowed_scopes since v1.14.0. No
migration, no environment variable, no change of default, no token-contract change.
Changed
client_updatedrecords a change ofclaim_mappings, with the old and new policy, like
allowed_scopessince v1.14.0. Claim mappings decide which claims a client's tokens carry (a
tenant, a role), so a change alters every token issued afterwards; until now an update that
changed only the mappings left no audit event. Restating a mapping's default target (access)
is not a change. No migration, no environment variable, no change of default; the webhook payload
ofclient_updatedgains the field when it changes.