Security audit #2

Merged
zevaryx merged 19 commits from audit into dev 2026-11-17 20:31:12 +00:00
Owner

Lots of small bug fixes, nothing severe

Lots of small bug fixes, nothing severe
One unfetchable guild or user no longer aborts the poll, a Forbidden unban
closes the ban instead of retrying forever, a ban extended after it was
queued is left alone, and the poll window now exceeds the poll interval.
The test fakes now raise the real NotFound/Forbidden errors.
The fetch happened outside the try, so a deleted or inaccessible channel or
guild left the lock active forever. The poll now filters on the computed
expiry, looks ahead further than its interval, and a lock or lockdown
extended after it was queued is not ended at its old time.
A failed role removal used to be swallowed and the record deleted, leaving the
member with the role forever, while a missing guild, member or role raised
before the record could be cleaned up. Failures other than NotFound now keep
the record for the next pass. Temproles and warnings extended after they were
queued are skipped, and their poll windows now exceed the poll interval.
One reminder that failed to queue no longer blocks the ones after it, and a
missing user deactivates the reminder. Delivery failures on the channel
fallback end the reminder instead of retrying every 5 seconds, an invalid cron
expression deactivates it instead of repeating the same DM, and the outcome is
saved before the message is sent so a failed save or delete cannot cause a
resend. A pass is capped, caches users and only fetches the channel when the
DM fails.
A deleted guild, a guild the bot cannot access, or a member that cannot be
kicked used to abort the pass for every guild after it. A vanished guild now
deletes its autokick setting, and members without a usable join time are
skipped.
SIGTERM and SIGINT now cancel the loops and pending jobs, then close the bot's
HTTP session and the database client. A loop that ends on its own stops the
others and exits with status 1, so the container's restart policy starts
everything afresh instead of leaving a half-dead process running.
Every poll now reads raw documents and validates each on its own, so one corrupt
record cannot abort a pass, and wraps scheduling per record. Fire-time changes to
bans, locks, lockdowns, warnings and temproles are conditional updates that match
only while the record is as queued. A ban made permanent is no longer lifted, the
lock query ignores documents without a numeric duration, a Forbidden temprole
removal is given up on after 24 hours (a Forbidden guild fetch counts as gone),
absurd autokick day counts are invalid, and no Unban is logged when nothing was
lifted.
Jobs already working get 8 seconds to finish on shutdown, and a reminder cancelled
mid-send is re-armed. A reminder that cannot be queued is left out of the next
passes with growing backoff so it cannot fill the batch, and a failing user lookup
is cached for the pass. State changes are conditional updates. The module
docstring now explains why delivery is at most once.
find_valid applied the limit in the query, so enough corrupt documents sorted first
filled every batch and starved the healthy ones behind them. It now skips invalid
documents and stops after the requested number of valid ones.
chore: bump version to 3.2.1 and pin jarvis-core 3.2.1 (0c864d7)
Some checks failed
CI / precommit (pull_request) Failing after 39s
CI / test (3.12) (pull_request) Successful in 1m31s
CI / test (3.13) (pull_request) Successful in 1m37s
CI / test (3.14) (pull_request) Successful in 1m44s
CI / test (3.15) (pull_request) Successful in 3m4s
CI / image (pull_request) Has been skipped
29d10672ec
style: capitalise the first word of the reminder back-off docstring (D403)
All checks were successful
CI / precommit (pull_request) Successful in 37s
CI / test (3.12) (pull_request) Successful in 1m41s
CI / test (3.13) (pull_request) Successful in 1m34s
CI / test (3.14) (pull_request) Successful in 1m37s
CI / test (3.15) (pull_request) Successful in 2m54s
CI / image (pull_request) Has been skipped
CI / precommit (push) Successful in 39s
CI / test (3.12) (push) Successful in 2m44s
CI / test (3.13) (push) Successful in 2m46s
CI / test (3.14) (push) Successful in 2m57s
CI / test (3.15) (push) Successful in 2m57s
CI / image (push) Successful in 9s
14affb9db0
zevaryx deleted branch audit 2026-11-17 20:31:12 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jarvis/jarvis-tasks!2
No description provided.