Skip to content

System Safety: close the instant route to a weaker auth tier, and gate the name switch like the privacy switch - #380

Merged
SiteRelEnby merged 1 commit into
mainfrom
fix/safety-gate-audit
Nov 7, 2026
Merged

SiteRelEnby merged 1 commit into
mainfrom
fix/safety-gate-audit

Conversation

@SiteRelEnby

Copy link
Copy Markdown
Contributor

Follow-up to a read-through of every edge where an owner can make information more visible. The exposure gates themselves held up; this fixes the three things found underneath them.

  • Lowering the auth tier always waits out the grace window. PUT /v1/systems/me/delete-confirmation wrote the tier directly after a password check, while PATCH /v1/system/safety deferred the same lowering behind the grace window. A session with the password could drop the tier to none in one call and every step-up after that checked nothing. The old endpoint now goes through the same split: raising applies at once, lowering is queued as a pending change (or applies at once with no window), visible and cancellable on GET /v1/system/safety. Response shape is unchanged, so a deferred lowering reads the old tier. Marked deprecated in favour of the settings PATCH. All three write paths to the safety columns (settings PATCH, this endpoint, native import) now share apply_safety_split, so there is one place the direction rule lives.
  • The native import holds the show-name switch over a live profile. show_name_publicly from a backup was applied as a plain display setting. Turning it on with the system public and a grant live is a raise that needs step-up on the owner path, so the import now leaves the name hidden in that case and under the operator publishing block, with a report line, the same shape as the existing system-privacy hold. Hiding, or restoring with nothing published, still applies. The PluralPort import reaches this through the native path.
  • The show-name raise meets the publishing-availability refusals. Pending deletion, the instance's public surface off, and the operator takedown latch all refuse raising privacy to public; the name switch skipped them and would have taken effect when the surface came back. It is now refused in the same cases and logged as an exposure raise under its own source (system_show_name). Hiding stays instant and ungated.

Client notes: web is already on the settings PATCH. Android declares the old tier endpoint but does not call it. iOS calls it from the delete-confirmation picker and updates optimistically with the selected level, so with a grace window set the picker will show a tier the server has not applied yet; the deferral is visible on the iOS System Safety screen meanwhile. The move to the settings PATCH is written up in the design docs.

Verification

  • Tier endpoint: lowering with a grace window queues a pending change, the live tier stays and still gates a delete, cancelling it works; raising applies at once; lowering with no window applies at once.
  • Import: name held with the profile live (anonymous page still unnamed, report line present), held under the takedown latch, restored with nothing behind it, and hidden over a live profile with no warning.
  • Name raise: 409 pending deletion, 403 surface off, 403 takedown latch, with hiding and going private still open in each; security event recorded once under its own source and not under the privacy source.
  • System safety, sharing, public profiles, import runner, system privacy, revision retention, admin safety reset, PluralPort parity and export/import parity suites pass against a rebuilt test stack with the public surface on, and the surface-off set with it off. Ruff clean.

…e the name switch like the privacy switch

The standalone PUT /v1/systems/me/delete-confirmation endpoint verified
the password and wrote the tier straight onto the row, while the same
change through PATCH /v1/system/safety was deferred behind the grace
window as a cancellable pending change. A weaker tier is a weaker
step-up on every gate that asks for one, so this was the one call that
got past all of them at once. The endpoint now goes through the same
split: raising applies at once, lowering waits out the window (or lands
at once when the window is 0), and the pending change is listed and
cancellable like any other loosening. The response is still the system
as it stands, so a deferred lowering reads the old tier. Marked
deprecated in favour of the settings PATCH, which reports applied and
deferred. The settings PATCH, this endpoint and the native import now
share one helper, `apply_safety_split`, so the three cannot disagree
about which direction waits.

The native import applied `show_name_publicly` from the file as a plain
display setting. Turning it on with the system public and a grant live
is a raise that PATCH /v1/systems/me demands step-up for, which an
import cannot give, so it now holds in that case and under the operator
publishing block, with a report line, the same shape as the system
privacy hold. Hiding, and restoring with nothing published, apply as
before.

Showing the name on PATCH /v1/systems/me now meets the same refusals as
raising privacy to public: pending deletion, the instance's public
surface off, and the operator takedown latch. Set while any of those
held, it would have taken effect when the surface came back. It is also
recorded in the security log as an exposure raise under its own source.
@SiteRelEnby
SiteRelEnby enabled auto-merge November 7, 2026 21:16
@SiteRelEnby
SiteRelEnby merged commit 401f0f1 into main Nov 7, 2026
24 checks passed
@SiteRelEnby
SiteRelEnby deleted the fix/safety-gate-audit branch November 7, 2026 21:21
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