Skip to content

Fix the fifth security review's findings - #89

Merged
entity merged 9 commits into
mainfrom
fix/security-audit-findings
Nov 18, 2026
Merged

entity merged 9 commits into
mainfrom
fix/security-audit-findings

Conversation

@entity

@entity entity commented Nov 17, 2026 •

Copy link
Copy Markdown
Owner

Fixes from the fifth security review, one commit per item. Each commit has its regression tests and updates docs/ and CHANGELOG.md where the behaviour changed.

  • Step-up: keyring.fresh only counts a recovery code beside another factor. Undoing an email change also removes recovery codes once nothing is left for them to recover, and a recovery code no longer counts as an established second factor for skipping the current address's confirmation.
  • Registration: a password the hasher can't take (with bcrypt, over 72 bytes or with a NUL byte) is refused for every address, whatever the action's rules. Anything else the action's create() throws is reported and answered like a taken address, with nothing sent. RegistrationTest had a test that pinned the old throw; it now checks the uniform answer and the report. With reveal_taken on, it still throws.
  • Flashed results: what a form or Inertia response flashes for the page (keyring.result) is now encrypted. Pages read it with the new Keyring::result(). This changes the front-end contract: session('keyring.result') now holds ciphertext. The Inertia example, the docs and UPGRADE.md are updated, and public-api.json gains result.
  • Password change: saved holding the user's row, only over the password current_password was checked against, and only while the session is still signed in. The app's action now runs inside that transaction (documented).
  • Verification link: a followed link is kept under a new session ID. That also changes the CSRF token, so a login tab already open in that browser needs a reload.
  • Security log and names: text in log entries is scrubbed to valid UTF-8, and an entry whose details can't be kept is logged without them, and a factor key taken from the URL is cut to fit its column. Authenticator names must be valid UTF-8 with no NUL, and the model cleans name whenever it's saved through it (import, a model update(), custom factors).

Testing

Ran vendor/bin/pest, pint --test, phpstan analyse and rector --dry-run at every commit.

Suite Passed Skipped
SQLite 1,816 10
PostgreSQL 18 1,814 12
Concurrency (PostgreSQL) 19 0
  • The new Concurrency case races a password change against a reset.
  • Two tests that need invalid UTF-8 stored in the database skip outside SQLite.
  • Not run against MySQL; CI covers it.

@entity
entity force-pushed the fix/security-audit-findings branch 4 times, most recently from 1a535a8 to 20dce8f Compare November 18, 2026 00:10
…emove codes an undone email change leaves nothing to recover
… the user fails, and refuse a password bcrypt can't hash, replacing the test that pinned the throw
…ing::result(), moving the test that read the plain flash
@entity
entity force-pushed the fix/security-audit-findings branch from 20dce8f to efdc8d5 Compare November 18, 2026 01:34
@entity
entity merged commit a0dde4a into main Nov 18, 2026
5 checks passed
@entity
entity deleted the fix/security-audit-findings branch November 18, 2026 10:18
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