alphaonelabs / alphaonelabs/learn

Security: JWT tokens have no expiry and admin page bypasses authentication

Open
#34 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HTML
Stars
2
Forks
21
PR merge metrics
No merged PRs in 30d

Description

While exploring the codebase I found two security issues worth discussing:

1. JWT tokens never expire
create_token in worker.py encodes no exp or iat claim.
verify_token never checks expiry. A stolen token is valid forever.

2. Admin page bypasses Basic Auth
wrangler.toml sets run_worker_first = ["/api/*"] only.
Requests to /admin are served directly by Cloudflare Assets,
bypassing the Basic Auth check in _dispatch entirely.

Happy to work on fixes for both if the team confirms these are
in scope. Tagging for discussion before writing any code.

Contributor guide

Open the contributing guide

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.

Research direction

Start in worker.py at create_token, verify_token, and _dispatch, then inspect wrangler.toml to understand how /admin is routed. Confirm with the maintainers that both security issues are in scope before coding. Done means token lifetime is enforced and /admin no longer bypasses authentication, with the relevant behavior covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
authentication, backend, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.