Skip to content

Fix low BAC profile authorization - #289

Open
r1kka6 wants to merge 1 commit into
OWASP-CTF:dc34-ctffrom
r1kka6:fix/broken-access-control-low
Open

r1kka6 wants to merge 1 commit into
OWASP-CTF:dc34-ctffrom
r1kka6:fix/broken-access-control-low

Conversation

@r1kka6

@r1kka6 r1kka6 commented Aug 10, 2026

Copy link
Copy Markdown

Summary

  • authorize low BAC profile access with the authenticated server-side user ID instead of the attacker-controlled user_id cookie
  • keep the role banner server-derived so forged user_role cookies do not change displayed authorization context

Verification

  • docker run --rm -v "$PWD":/work -w /work php:8.3-cli php -l vulnerabilities/bac/source/low.php
  • vulnerable baseline discloses user 2 profile when user_id=2 is supplied in both the query and cookie
  • patched runtime denies forged user_id=2 for an authenticated admin session and still allows the admin user to view user_id=1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant