apple / cups

Apple CUPS Sources
https://www.cups.org
Apache License 2.0
1.85k stars 452 forks source link

webui falls back to :631 when accessed remotely via port forwarding #6158

Open nerdoc opened 6 months ago

nerdoc commented 6 months ago

I am using cups 2.4.1 (I know this is an older version, on Ubuntu 22.04 LTS, but I have co current CUPS available - but I doubt that this is fixed yet), and connecting to it via ssh, and port forwarding via ssh -L 8000:localhost:631 myhost. So I can access the remote CUPS at localhost:8000.

navigating to http://localhost:8000/printers/<printer-name> and choosing an action from "Maintainance" or "Administration" combo boxes does that correctly, here e.g. "Set as server default". I get to the confirmation page, which stays a few seconds, and then it auto-redirects back to http://localhost:631/printers/<printer-name>

Mark that it redirects to fixed localhost:631, and not to localhost:8000

This could be a big problem, as mostly on localhost:631 there is running a CUPS too, and the next step changing or deleting a printer is then done on localhost, unknowingly, as the pages look identical. This could lead to crucial problems.