Security context

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

nonebot/nonebot2
master @ 6c2871c
6
Fixes
1
CVEs
HIGH
Peak severity
Highlights
Auth Bypass: 4 prior fixes. Scrutinize any change in this area.
command.py: most-fixed (2 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: Historically, command handling in NoneBot2 has suffered from flawed permission verification logic, including hardcoded superuser IDs and improper permission checks, allowing unauthorized command execution. Strict environment-configured validation must be used instead.
Sandbox Bypass: Improper input validation in MessageTemplate parsing allowed arbitrary python object traversal via private attributes, risking information disclosure or code execution. Developers must restrict access to private attributes starting with underscores.
Auth Bypass: Webhooks in adapters like CQHTTP lacked constant-time comparison for signature validations, risking authentication bypass through timing attacks. Always use secure, constant-time comparison for webhook validation.