Repository navigation
This hotfix closes an authentication bypass and stops the SFTP host key from being served as a file. With SFTP enabled, setups that keep the key inside the served root no longer start, see Upgrading below.
Bug Fixes
- fix auth bypass through an encoded slash after /assets #62 @umputun
- refuse an SFTP host key inside the served root #62 @umputun
- refuse an SFTP key path containing
..#62 @umputun
Auth bypass. With --auth set, a URL with an encoded slash after /assets, such as /assets%2F..%2Fsecret.txt, skipped the login check and returned the file. Every served file was readable without a password.
SFTP host key. With --sftp.enabled and the defaults --root . and --sftp.key weblist_rsa, the generated SFTP private host key sat among the served files. Any logged-in user could download it, and through the bypass anyone could. With SFTP enabled, the server now refuses to start when the key path resolves inside the served root, passes through a symlink to a missing target, or contains ...
Upgrading. If weblist refuses to start with an error saying the SFTP host key is inside the served root, the old key sat among the served files. If anyone could have downloaded it, treat it as compromised: delete it from the served directory, point --sftp.key at a new path outside the root so weblist generates a new key, and have SFTP clients check the new fingerprint (ssh-keygen -lf <key> prints it) before they accept it. Only a key that was never reachable should keep its identity. In that case move it out of the served directory and point --sftp.key at the new path, since a copy left behind stays downloadable.