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
proofline login opens and prints the server's sign-in address and code without checking them #81
When you run proofline login, the server sends back a web address (the approval page) and a short code. The CLI opens that address in your browser without checking that it is on the Proofline site, and prints the code without removing hidden control characters.
Why it happens
device::start (src/device.rs:64-86) reads the server's reply and keeps verification_uri, verification_uri_complete and user_code exactly as sent.
login (src/lib.rs:685-707) prints user_code with format!, and passes the address to webbrowser::open after only checking that it parses as some URL. Any scheme and any host pass: https://other-site.example/…, file:///…, or a custom protocol handler.
A control character is an invisible character that tells the terminal to do something, such as ESC[2J (clear the screen). A bidi control such as U+202E makes the terminal show the following text reversed. Both reach the terminal unchanged.
Everywhere else the CLI treats server text as untrusted: problem details go through text::terminal_safe (src/api.rs), and review fields through text::one_line. Proofline's own Chrome extension refuses this exact field when it is off-origin (lib/proofline/auth.ts: new URL(code.verification_uri_complete).origin !== PROOFLINE_ORIGIN). The CLI's sign-in is the one path that skips both.
Who is affected
With the default https://proofline.sh this is defense in depth. It matters when the origin is custom (--base-url / PROOFLINE_BASE_URL, e.g. a local or staging console), mis-routed, or compromised: the reply can then send the person to a look-alike approval page, open a file: or custom-scheme URL, or rewrite the sign-in prompt.
How to see it
A tiny stand-in server whose /auth/device/code answers "user_code": "WDJB-MJHT\u001b[2JTHJM", then:
proofline login --base-url http://127.0.0.1:8765 --no-browser 2>&1 | cat -v
Your sign-in code is WDJB-MJHT^[[2JM-bM-^@M-.THJM.
The ^[[2J and the U+202E bytes go straight to the terminal. With "verification_uri_complete": "https://proofline-login.example/approve" the reply is accepted, and without --no-browser that page is opened.
Suggested fix
In device::start, refuse a reply whose verification_uri / verification_uri_complete is not on http.origin(), or whose user_code holds a control or bidi character, with a regression test in tests/http.rs. I have a PR ready.
Activity
Ahmar004 commentedon Nov 23, 2026
I had solved this issue in a PR at #82
Kindly have a look at that PR,
Thanks!