{"id":"GHSA-f346-8rp3-4h9h","summary":"TSPortal's Uncontrolled User Creation via Validation Side Effects Leads to Potential Denial of Service","details":"### Summary\nA flaw in TSPortal allowed attackers to create arbitrary user records in the database by abusing validation logic. While validation correctly rejected invalid usernames, a side effect within a validation rule caused user records to be created regardless of whether the request succeeded. This could be exploited to cause uncontrolled database growth, leading to a potential denial of service (DoS).\n\n### Details\nWhen submitting a Data Processing Agreement (DPA) request in TSPortal, the `DPAAlreadyLive` validation rule previously called `User::findOrCreate()`.\n\nThis method created a user record if one did not already exist.\n\nAlthough username validation (via `MirahezeUsernameRule`) correctly rejected invalid usernames, the `DPAAlreadyLive` rule was still executed during validation. Because it performed a state-changing operation, it created user records even when the overall validation failed and no DPA was created.\n\nAs a result:\n- Validation correctly rejected invalid input\n- However, user records were still inserted into the database as a side effect\n\nThese records were created:\n- Without a successful DPA request\n- Without audit logging tied to a completed action\n- Without visibility into their origin\n\n### Impact\nAn attacker could exploit this behavior by automating requests with invalid usernames, resulting in:\n\n- Mass creation of arbitrary user records\n- Unbounded database growth\n- Increased storage and indexing overhead\n- Potential degradation of application performance\n\nAt scale, this could lead to a denial of service condition due to resource exhaustion.\n\n### Proof of Concept\n1. Submit a DPA request using an invalid username\n2. Ensure the request fails validation due to `MirahezeUsernameRule`\n3. Observe that a corresponding user record is still created in the database\n\nThis behavior was confirmed prior to remediation.\n\n### Root Cause\nThe issue stemmed from:\n- Performing state-changing operations (`findOrCreate`) inside validation logic\n- Validation rules executing regardless of overall validation success\n- Lack of separation between validation and persistence layers\n\n### Mitigation\nThe issue has been fixed by removing database write operations from validation logic.\n\nSpecifically:\n- Replaced `User::findOrCreate()` with a non-mutating lookup (`User::firstWhere(...)`)\n- Ensured validation rules only perform read operations\n- Prevented user creation unless all validation passes","aliases":["CVE-2026-33541"],"modified":"2026-03-27T16:12:05.202203Z","published":"2026-03-27T15:42:20Z","database_specific":{"nvd_published_at":"2026-03-26T21:17:05Z","cwe_ids":["CWE-400","CWE-770"],"severity":"MODERATE","github_reviewed":true,"github_reviewed_at":"2026-03-27T15:42:20Z"},"references":[{"type":"WEB","url":"https://github.com/miraheze/TSPortal/security/advisories/GHSA-f346-8rp3-4h9h"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-33541"},{"type":"PACKAGE","url":"https://github.com/miraheze/TSPortal"},{"type":"WEB","url":"https://issue-tracker.miraheze.org/T15115"}],"affected":[{"package":{"name":"miraheze/ts-portal","ecosystem":"Packagist","purl":"pkg:composer/miraheze/ts-portal"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"34"}]}],"versions":["v1","v10","v11","v12","v13","v14","v15","v16","v17","v18","v19","v2","v20","v21","v22","v23","v24","v25","v26","v27","v28","v29","v3","v30","v31","v32","v33","v4","v5","v6","v7","v8","v9"],"database_specific":{"last_known_affected_version_range":"\u003c= 33","source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/03/GHSA-f346-8rp3-4h9h/GHSA-f346-8rp3-4h9h.json"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H"}]}