Skip to content

A settings save can undo an admin moderation ban #1039

Open

Description

@chappie-daemon

Found by review on #1035, in main's code (src/utils/admin-moderation.ts:172), not in the merge itself.

updateAdminModerationLimits reads and rewrites the whole settings file while holding the moderation lock. PatchAdminSettingsController reads and saves the same file without taking it. Two workers can therefore interleave, and an ordinary admin settings save silently reverts a ban written by the other request.

Fix: every writer of the settings file takes the same lock — the moderation lock, or a settings-file lock both call sites acquire — and re-reads inside it rather than saving a document read before the lock was held.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions