Operator precedence bug in privilege checks

Open Beginner friendly
#69 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
php
Domain
backend, security

Research direction

Start by reading inc/Do.php at lines 155, 217, and 1055, along with the surrounding privilege checks and updateBanBancho() calls. Verify the operator grouping at each location and confirm that the second argument reflects the intended privilege-bit check rather than always evaluating to false.

Written by the indexing model from the issue text.

Description

PHP's == binds tighter than &, so $_POST["priv"] & Privileges::UserPublic == 0 evaluates as $_POST["priv"] & (Privileges::UserPublic == 0). The second argument to updateBanBancho() is always 0/false.

inc/Do.php, lines 155, 217, 1055

Dominant language
PHP
Stars
1
Forks
3
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from osuAkatsuki/admin-panel

All issues in osuAkatsuki/admin-panel

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.