Four things around stored credentials, found while reading config.ts and
cli.ts. The first is a behaviour bug; the rest are hardening and docs.
1. olcli logout leaves .olauth in place
logout calls clearConfig(), which clears the conf store and nothing
else. getSessionCookie() resolves in this order:
OVERLEAF_SESSION
.olauth in the current directory
- the global config
So a user who authenticated with --save-local runs logout, sees
Credentials cleared in green, and is still authenticated in that directory
— via the source that takes precedence over the one that was actually
cleared. The message is what makes this worse than the leftover file: it
states an outcome that did not happen.
Fix could be as small as deleting .olauth in cwd when present, or
reporting what was and was not cleared.
2. The account password is persisted in plaintext by default
setPasswordCredentials() writes loginEmail and loginPassword to the
same plaintext JSON as everything else. --no-save-password exists, but the
default is to save.
A session cookie in plaintext is normal — gh stores tokens the same way.
A password is a different asset: it is reusable outside olcli, it survives
cookie rotation, and it cannot be revoked without changing it. Given that
password login exists mainly for self-hosted instances without reCAPTCHA,
persisting it by default buys convenience in exactly the deployments most
likely to be shared or multi-user.
Worth considering: default to not saving, and let the cookie obtained from
the login carry the session — persistClientSession() already stores it.
3. --password lands in shell history
olcli auth --email … --password … is the only documented password path, and
it puts the password in ~/.zsh_history verbatim. A prompt-based entry (no
value on the command line) would cost little and is what most CLIs do.
4. The documented config path is wrong on macOS
README says:
3. Global config: `~/.config/olcli-nodejs/config.json`
conf resolves to ~/Library/Preferences/olcli-nodejs/config.json on macOS.
Since getConfigPath() already exists and auth prints it, the README could
point at that instead of hardcoding a path that is right on one platform.
While there: nothing currently tells a user that --save-local writes
.olauth into whatever directory they happen to be in — usually their LaTeX
project. This repo gitignores .olauth; the user's own repo will not.
None of this is remotely exploitable — it is all local storage and local
output. Happy to send a PR for any subset. #1 seems worth doing regardless
of what you think of the rest.
Four things around stored credentials, found while reading
config.tsandcli.ts. The first is a behaviour bug; the rest are hardening and docs.1.
olcli logoutleaves.olauthin placelogoutcallsclearConfig(), which clears theconfstore and nothingelse.
getSessionCookie()resolves in this order:OVERLEAF_SESSION.olauthin the current directorySo a user who authenticated with
--save-localrunslogout, seesCredentials clearedin green, and is still authenticated in that directory— via the source that takes precedence over the one that was actually
cleared. The message is what makes this worse than the leftover file: it
states an outcome that did not happen.
Fix could be as small as deleting
.olauthincwdwhen present, orreporting what was and was not cleared.
2. The account password is persisted in plaintext by default
setPasswordCredentials()writesloginEmailandloginPasswordto thesame plaintext JSON as everything else.
--no-save-passwordexists, but thedefault is to save.
A session cookie in plaintext is normal —
ghstores tokens the same way.A password is a different asset: it is reusable outside olcli, it survives
cookie rotation, and it cannot be revoked without changing it. Given that
password login exists mainly for self-hosted instances without reCAPTCHA,
persisting it by default buys convenience in exactly the deployments most
likely to be shared or multi-user.
Worth considering: default to not saving, and let the cookie obtained from
the login carry the session —
persistClientSession()already stores it.3.
--passwordlands in shell historyolcli auth --email … --password …is the only documented password path, andit puts the password in
~/.zsh_historyverbatim. A prompt-based entry (novalue on the command line) would cost little and is what most CLIs do.
4. The documented config path is wrong on macOS
README says:
confresolves to~/Library/Preferences/olcli-nodejs/config.jsonon macOS.Since
getConfigPath()already exists andauthprints it, the README couldpoint at that instead of hardcoding a path that is right on one platform.
While there: nothing currently tells a user that
--save-localwrites.olauthinto whatever directory they happen to be in — usually their LaTeXproject. This repo gitignores
.olauth; the user's own repo will not.None of this is remotely exploitable — it is all local storage and local
output. Happy to send a PR for any subset. #1 seems worth doing regardless
of what you think of the rest.