# TeamPass folder re-parenting authorization bypass

TeamPass update_folder lacks authorization checks, letting any authenticated user re-parent any folder into their personal space and read its credential metadata.

- Payout: Research
- Severity: high
- Program: TeamPass
- Found by: arpitjain099
- Disclosed: 2026-11-20
- CVE: CVE-2026-103035
- Write-up quality: 7/10
- Original: https://github.com/advisories/GHSA-66q9-mxf2-xqw6
- Library page: https://bugbountylibrary.com/r/ghsa%3AGHSA-66q9-mxf2-xqw6
- Tags: area:web domain:web impact:data-leak impact:integrity kind:research platform:ghsa sev:high tech:php technique:source-review vuln:access-control vuln:auth-bypass vuln:idor

**Target:** PHP web app folder-management endpoint (app/sources/folders.queries.php)
**Root cause:** The update_folder case never validates the target folder id or submitted parentId against the caller's user-accessible_folders set, and the file has no session/authorization gate at all, unlike sibling actions add_folder/delete_folders/copy_folder.
**Steps:**
1. Authenticate as any non-read-only TeamPass user.
2. Submit `update_folder` with the victim folder's id and `parentId` set to the attacker's own personal folder.
3. Personal-folder computation sets `$isPersonal = 1`, satisfying the line 503 guard `(int) $isPersonal === 1`.
4. Update writes new parent and `personal_folder = 1` for the target folder.
5. On next login the stolen subtree appears in the attacker's accessible set; `do_items_list_in_folder` returns plaintext label, login, url, email, description of each item.
**How found:** Source review of folders.queries.php: grep for checkSession/userAccessPage returned zero hits, and comparing update_folder against sibling actions revealed it was the only folder-mutating case without an accessible-folders predicate; the personal-folder short-circuit at line 503 was the bypass lever.
**Exploitation:** Low-privilege authenticated user re-parents a victim team's folder into their personal folder, gaining read access to credential metadata (passwords remain sharekey-protected) and removing the folder from the organization view for all other users including admins.
**Escalation:** Possible unauthenticated variant: omitted `key` POST param and null session key make `null !== null` fail open, and prepareExchangedData takes plaintext-JSON branch since encryptClientServer is only set in public/index.php; unverified live.
**Insight:** When auditing multi-action PHP endpoint files, diff authorization predicates across sibling cases in the same switch — the one action missing the accessible-set check is the bug, and any short-circuit guard (like isPersonal) can be steered by attacker-controlled input to satisfy it.

