Skip to content

Releases

Socrate v1.16.2

Choose a tag to compare

@github-actions github-actions released this 27 Nov 07:15
fcb37ee

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_age that ended in login_required after a fresh
    sign-in on the login page now gets a code; under ACR_VALUES_MODE=enforce only, the new error
    unmet_authentication_requirements.
  • acr_values: run ACR_VALUES_MODE=observe and look for acr_values_unmet events before
    enforce; a user without MFA turned on cannot meet acr_values=mfa. Clients must still check
    acr/amr in the token (bff.StepUp.Satisfied, backendkit v1.29.0).

Fixed

  • max_age on /oauth/authorize can be met, 0 included. The check ran when the user clicked
    Allow on the consent page, measuring the time since the sign-in: max_age=0 therefore always
    ended with login_required (re-authentication required), and a small max_age did 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 any max_age; an earlier sign-in is checked as before.
    The tokens carry that sign-in's auth_time, amr and acr. Client-facing change: a request
    with max_age that ended in login_required after a fresh sign-in now gets a code.

Added

  • acr_values=mfa can require a second-factor sign-in (ACR_VALUES_MODE, default off). A
    client asking for a step-up sign-in before a sensitive action could not require a second factor:
    acr_values was ignored, although discovery advertises acr_values_supported
    ["pwd","mfa"]. Under enforce, a request whose acr_values names mfa (and not pwd) 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);
    observe issues the code and audits acr_values_unmet; off changes 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 under enforce. The client must still check acr/amr in the
    token (as bff.StepUp.Satisfied does): acr_values passes through the browser like every
    authorization parameter, so a user can drop it. Deploy note: a user without MFA turned on
    cannot meet acr_values=mfa; run observe first.

Documentation

  • The production env template lists every opt-in control. deploy/env/socrate.env.example
    gains MFA_RECOVERY_CODES_REVERIFY_MODE (v1.16.1), AUDIT_INTEGRITY_SCAN_INTERVAL_SECONDS and
    _LOOKBACK_SECONDS, and ADMIN_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

Choose a tag to compare

@github-actions github-actions released this 26 Nov 09:06
190c441

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 on admin_logs.app_id and rewrites no data.
  • Client-facing changes:
    • the sign-in attempt that locks an account answers 401 invalid_credentials instead of 403
      account locked;
    • POST /api/profile/mfa/confirm answers 200 with the first recovery_codes instead of
      204;
    • the /api/profile/mfa posts are rate-limited per user (429);
    • POST /api/profile/mfa/disable answers 403 once the account is locked.
  • Recovery codes: deploy the admin console v1.7.4 (it sends the password and a code, and takes
    confirm's codes), then run MFA_RECOVERY_CODES_REVERIFY_MODE=observe and look for
    mfa_recovery_codes_reverify events with would_refuse_missing before enforce.
  • Token exchange and DPoP changes apply only with TOKEN_EXCHANGE_MODE or DPOP_MODE on.
    An existing public client with allow_token_exchange keeps 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, default off). 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. Under enforce it needs {"password","code"}, checked as for MFA disable (each wrong
    one counts toward the lockout; 400 without them, 401 when wrong, 403 once locked);
    observe allows and audits mfa_recovery_codes_reverify with whether the request carried
    them; off changes nothing. So that turning MFA on still gives the first codes, POST /api/profile/mfa/confirm now answers 200 with them (recovery_codes) instead of 204: 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 is enforce. Deploy note:
    upgrade the admin console (which sends the password and code, and takes confirm's codes)
    before setting observe or enforce. 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/disable checked 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/mfa posts 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 answered 403 account locked, an answer an unknown email never
    gets, so a few wrong passwords told whether an email names an account. That attempt is now
    answered 401 invalid 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 gets 403 account locked. With
    LOCKOUT_SOURCE_MODE=enforce the same holds for the source lock. A wrong MFA code that locks
    the account still answers 403: whoever sent it has passed the password check. Client-facing
    change: the locking attempt's status moves from 403 to 401; 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_MODE shadow or enforce; 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 (400 on 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.
  • /oauth/revoke and /oauth/logout check 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: under enforce such a token is ignored and the request is
    handled as anonymous; under observe the failure is logged and the token accepted; under
    off nothing changes. They also accept the DPoP scheme when binding is on.

Fixed

  • cmd/seed -force ends earlier password-reset links. Resetting the superadmin with
    -force set a new password without recording when, so a reset link issued before it stayed
    valid; it now sets password_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 from admin_logs.app_id to apps made 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

Choose a tag to compare

@github-actions github-actions released this 26 Nov 03:50
6947800

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 if alert_rules is empty, touches no other table and rewrites no data;
    on a fresh install it creates alert_rules.
  • Alert rules: nothing is evaluated until ALERT_RULES_MODE is set. Run observe, 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, then enforce. Email needs SMTP configured.
  • Exact redirect URIs: run REDIRECT_URI_MATCH_MODE=observe and look for
    redirect_uri_inexact_match events (the consoles' callbacks included) before enforce.

Added

  • Alert rules are evaluated (ALERT_RULES_MODE, default off, #258). Rules could be created in
    the monitoring console, but nothing evaluated them, so no alert was ever raised. Under observe,
    every ALERT_RULES_INTERVAL_SECONDS (default 60) each enabled rule counts its event type in its
    window, per group of its group_by; a group that reaches the threshold records a triggered
    alert (alert history, an alert_triggered security event), once per group and window. enforce
    also sends the rule's notifications: email to its recipients (needs SMTP), its alert as JSON to
    its webhook_url, or a Slack message, over https to 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/rules reports the mode as evaluation_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 (default off) and ALERT_RULES_INTERVAL_SECONDS; run observe first and
    read the alert history before enforce.
  • 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 until ALERT_RULES_MODE is set. A server that already has rules keeps only
    its own. docs/ALERT-RULES.md lists them, lists the event types never recorded (a rule on them
    never triggers), and its examples no longer use rate_limit_exceeded or
    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,
    default off). 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. observe audits redirect_uri_inexact_match at code issuance when only
    the normalized form matched (the client and the URI it sent); enforce refuses it as not
    registered, and audits the refusal: on the authorization page (before sign-in), at code issuance
    and for post_logout_redirect_uri. docs/API.md no longer says the match was exact. Deploy
    note: new variable REDIRECT_URI_MATCH_MODE, default off; run observe and fix the
    registrations or clients it names before enforce (#261).

Socrate v1.15.0

Choose a tag to compare

@github-actions github-actions released this 25 Nov 18:53
29989ac

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 to authorization_codes,
    0036 drops the foreign key from security_audit_logs.app_id to apps. None rewrites data; all
    work on a fresh install. Audit rows whose app_id an 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 a code_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 bare user_id (backendkit's pep already 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 401 like any wrong password, not 403.
  • Stored A4 policies (POLICY_MODE shadow/enforce): add the app-admins rule and the new
    step-up actions to destructive-step-up (see docs/EXTENSIBILITY.md); with POLICY_MODE=off,
    the default, nothing changes.
  • New modes are off by default; run each in observe and read its audit events before
    enforce.

Security

  • Deleting an app no longer rewrites its audit rows. The audit log's app_id had a foreign key
    to apps, so deleting an app first set app_id to null on every audit row naming it: the rows
    lost their attribution and, app_id being covered by each row's hash, the integrity scan reported
    them as tampered. The client_deleted event, 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_id without 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; PKCERequired also 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, and prompt=login was 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=login is carried through the login and consent forms, and the
    consent step answers login_required unless 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-For entry. 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 with trusted_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
    in TRUSTED_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 in TRUSTED_PROXIES (#366).

  • A replayed authorization code can revoke the tokens it was redeemed for (CODE_REPLAY_MODE,
    default off). 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-token jti
    it was redeemed for (migration 0035). observe audits a replay as auth_code_failed with
    reason: code_replayed; enforce also 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; under enforce a
    refresh whose code cannot be kept is refused (server_error, the old refresh token stays good
    to retry with), under observe it 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 variable CODE_REPLAY_MODE, default off; with it
    on, authorization_codes keeps 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 with UserRepository.Update only to record the last-login time, writing
    back every column Update does 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 new UserRepository.RecordLogin,
    which writes only last_login (and last_login_attempt where 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 got 404 unknown subject unless 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's pep always sends); by id they are a 404 like 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...

Read more

Socrate v1.14.6

Choose a tag to compare

@github-actions github-actions released this 24 Nov 15:25
1c85b17

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.
    With TOKEN_EXCHANGE_MODE=enforce (default off), 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 with 403 unauthorized_client even when it has
    allow_token_exchange, a wrong or missing secret with 401 invalid_client, a deactivated
    client with 400 unauthorized_client, and a client registered with require_dpop without a
    DPoP proof with 400 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_client or dpop_required). In shadow mode
    every refusal still answers unsupported_grant_type. Deploy note: no migration, no environment
    variable, no change of default; a public client that had allow_token_exchange must become a
    confidential client to keep exchanging.

  • Token exchange checks the presented tokens like the refresh grant. With
    TOKEN_EXCHANGE_MODE=enforce (default off), a subject or actor token is now refused
    (400 invalid_grant) when its jti is 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_reason subject_revoked,
    subject_dpop_mismatch, subject_token_version, subject_locked, subject_unknown_user, or
    the same with actor_). 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 (a client_credentials token, sub app:<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_app otherwise), 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.
    With TOKEN_EXCHANGE_MODE=enforce (default off), each requested
    audience and resource must be one of the client's registered audiences (set by an
    operator in the admin console), otherwise 400 invalid_target; the exchanged token's aud is
    the requested audiences and resources together (a resource-only request used to yield a token
    without aud). In a delegation, the actor token must belong to the requesting client — issued
    to it (aud[0] is its client_id) or its own service-account token — otherwise
    400 invalid_grant (deny_reason actor_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/v5 5.3.2 → 5.5.0 (GHSA-j6qf-3m9c-vwj3, client IP from
    X-Forwarded-For in chi's ClientIPFromXFF) and golang.org/x/crypto 0.57.0 → 0.59.0
    (GO-2026-5932, the deprecated openpgp package), with x/sync, x/sys and x/text following.
    Socrate uses neither affected code path (client IPs come from its own ClientIP middleware since
    P3-2, and nothing imports openpgp; 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 a uint, so an id too large for uint is
    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 both Dockerfile base images to a digest, so a moved tag cannot change what CI or
    the image build runs; Dependabot (already configured for github-actions and docker) keeps
    the pins current. The Release workflow 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, and scratchDB gets its doc comment back. No runtime change.

  • Tests: TestPostgresRateLimitStore_WindowsAreSeparate no 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

Choose a tag to compare

@github-actions github-actions released this 23 Nov 21:37
5c7776a

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 0 column 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/login and POST /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_locked event with reason mfa_invalid). A locked account is refused before any code
    is checked, on /api/admin/elevate too, which now answers 403 account is locked like 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

Choose a tag to compare

@github-actions github-actions released this 23 Nov 19:53
f71a137

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/authorize ignores an Authorization header. 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=none therefore always redirects with
    login_required (a request with a bearer token used to get consent_required). Browser flows
    are unchanged, as browsers do not send an Authorization header 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

Choose a tag to compare

@github-actions github-actions released this 23 Nov 18:40
297dfec

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 in net/http (fixed in 1.27.4) and GO-2026-6809 in crypto/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 existing 409 answer for an account that
    is already in use, and an invite_accepted audit event with success=false and 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}/users or /service/users) a pending account created by another app's
    invite still assigns the role, but receives no invite_token and 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

Choose a tag to compare

@github-actions github-actions released this 11 Oct 12:19
d586814

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.sh expects, 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, --apply to change): installs
    PostgreSQL 16 (PGDG on 22.04) and Caddy; creates the socrate, socrate-admin-bff and
    socrate-mon-bff users, the directories, the socrate role 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's done: OK ... migrations=<n>, with a daily
    cron) and the Caddy sites in the form socrate-caddy-update.sh edits. 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.sh runs 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;
    migrations 0001–0030), .env.example (no JWT_SECRET; token rate limit, _MS windows,
    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

Choose a tag to compare

@github-actions github-actions released this 11 Oct 09:53
bb8ae4b

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_updated records a change of claim_mappings, with the old and new policy, like
    allowed_scopes since 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
    of client_updated gains the field when it changes.