alphaonelabs / alphaonelabs/learn
Security: JWT tokens have no expiry and admin page bypasses authentication
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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