Security context

What an agent needs to avoid regressing past fixes and find the next vuln in this repo.

bwmarrin/discordgo
master @ f43dd94
5
Fixes
0
CVEs
HIGH
Peak severity
80.0%
Coverage
Highlights
Auth Bypass: 5 prior fixes. Scrutinize any change in this area.
restapi.go: most-fixed (3 issues). Treat as high-risk during review.
5 high-severity fixes in this history; regressions here are high-impact.
Recurring patterns

The bug types that recur here, drawn from past fixes, not open vulnerabilities.

Auth Bypass: Incorrect bitwise shifts and iota offsets for PermissionViewChannel caused incorrect permission evaluations, leading to potential access bypasses for restricted channels. Developers should ensure all constant-defined bitmasks are thoroughly unit-tested for mathematical accuracy.
Auth Bypass: Flaws in UserChannelPermissions calculations, including improper handling of @everyone permission overrides and incorrect role-based permission accumulation, allowed unauthorized users to bypass channel restrictions. Hierarchical evaluation logic must strictly adhere to the expected order of operations for denies and allows.
Auth Bypass: An over-privileged mapping in REST and state management logic incorrectly mapped PermissionManageRoles to PermissionAllChannel, granting administrative-level access to users without full Administrator privileges. Only explicit PermissionAdministrator checks must gate full channel access.