You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Security: JWT tokens have no expiry and admin page bypasses authentication #1115
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.
Hey @bilalahmadsheikh
I've too taken a look at this, and yeah you are right regarding both the vulnerabilities, good catch.
Happy to see you've waited and first started with the discussion before going for a PR.
Just i would suggest: that do mention this on Slack (and also from the next time any of your ideas/discussions on there first) and take suggestions on your next step from there, the community is more active on slack.
I am interested in implementing JWT expiration support by adding exp and iat claims during token creation and validating token expiry during verification.
Please let me know if there are any implementation preferences before I start.
Update on the admin-auth-bypass half: I built and verified a fix for this (routing /admin through the Worker via run_worker_first, plus a related fix in serve_static), opened as PR alphaonelabs/learn#82.
While resolving a merge conflict against main, I found this half is already fixed there — run_worker_first already includes /admin, /admin/, /admin-, and serve_static already has a proper env.ASSETS fallback with backward compatibility for the old binding. Looks like this was resolved independently, possibly around the same time I was working on it.
Confirmed locally that /admin on current main correctly requires Basic Auth. I'm closing alphaonelabs/learn#82 since it's now redundant. The JWT-expiry half of this issue still looks open and unclaimed.
Activity
Shubhashish-Chakraborty commentedon Mar 31, 2026
Hey @bilalahmadsheikh
I've too taken a look at this, and yeah you are right regarding both the vulnerabilities, good catch.
Happy to see you've waited and first started with the discussion before going for a PR.
Just i would suggest: that do mention this on Slack (and also from the next time any of your ideas/discussions on there first) and take suggestions on your next step from there, the community is more active on slack.
jayati04 commentedon Jun 12, 2026
Hi, I would like to work on this issue.
I am interested in implementing JWT expiration support by adding exp and iat claims during token creation and validating token expiry during verification.
Please let me know if there are any implementation preferences before I start.
ayesha1145 commentedon Sep 20, 2026
Update on the admin-auth-bypass half: I built and verified a fix for this (routing /admin through the Worker via run_worker_first, plus a related fix in serve_static), opened as PR alphaonelabs/learn#82.
While resolving a merge conflict against main, I found this half is already fixed there — run_worker_first already includes /admin, /admin/, /admin-, and serve_static already has a proper env.ASSETS fallback with backward compatibility for the old binding. Looks like this was resolved independently, possibly around the same time I was working on it.
Confirmed locally that /admin on current main correctly requires Basic Auth. I'm closing alphaonelabs/learn#82 since it's now redundant. The JWT-expiry half of this issue still looks open and unclaimed.