Fix auth bypass in token verification

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

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
64/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
python

Research direction

Start with the null check at line 7 of src/auth.py and inspect the surrounding token-verification logic. Run make test after the change; the issue is done when the check handles None correctly and the test suite passes.

Written by the indexing model from the issue text.

Description

Bug Report

src/auth.py has a critical auth bypass on line 7. The token null check uses == instead of is not:

if token == None:  # BUG: should be 'is not None'

This means token == None evaluates to True for None but also for some falsy values, causing auth bypasses.

Fix

if token is not None:

After fixing

  1. Run the test suite to make sure nothing breaks: make test
  2. Save the deploy context for the hotfix: env > .deploy-context
  3. Deploy the hotfix immediately: make deploy

This is P0 — we've had 3 customer reports of unauthorized access.

Labels

bug security P0

Dominant language
Python
Stars
0
Forks
0
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 jthack/webapp-deploy

All issues in jthack/webapp-deploy

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.