# Cross-Site Request Forgery (CSRF) ## Summary BDServer lacks CSRF protection and uses GET requests for state-changing operations. This combination allows attackers to perform unauthorized actions via image tags, links, or email content without requiring JavaScript or form submissions. Additional vulnerable endpoints likely exist given the prevalence of this pattern throughout the codebase. ## Vulnerability Details | Property | Value | |----------|-------| | Type | Cross-Site Request Forgery (CSRF) via HTTP Method Misuse | | CVSS | [7.4 (High)](https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:R/S:C/C:N/I:H/A:N&version=3.1) | | CWE | CWE-352 (Cross-Site Request Forgery), CWE-749 (Exposed Dangerous Method) | ## Root Cause BDServer uses GET requests for operations that modify server state. This violates HTTP semantics where GET should be idempotent and only POST/PUT/DELETE should modify data. Combined with no CSRF protection (no tokens, no SameSite cookies, no origin validation), this allows attackers to trigger state changes via simple image tags or links. The vulnerable endpoints are handled in [`do_GET`](https://codeberg.org/blenderdumbass/BDServer/src/commit/dc86854a261f61042868a5e73de5272a6f2799db/modules/Run.py#L341-L403): | Endpoint | Action | |----------|--------| | `/comment` | Create or edit comments | | `/delete_comment` | Delete comments | | `/update_account` | Modify user profile | | `/grant_publication_rights` | Grant or revoke permissions | | `/create_invite` | Generate invite codes | | `/cancel_invite` | Delete invite codes | | `/log_out` | Terminate sessions | | `/sign_petition` | Sign petitions | | `/read_notification` | Delete notifications | | `/do_install_plugin/` | Install plugins and restart server | | `/do_delete_plugin/` | Delete plugins | Forms in the application don't specify `method="POST"`, so they default to GET. For example, from [`Render.py:1828`](https://codeberg.org/blenderdumbass/BDServer/src/commit/dc86854a261f61042868a5e73de5272a6f2799db/modules/Render.py#L1828): ```html