Hacker News new | past | comments | ask | show | jobs | submit login

curl should probably scream when it detects piping unencrypted wan (not local ips) connections to shell, sort of like what openssh does when a host’s fingerprint changes



How could curl detect where it's piped to?


Something like (in Python)

os.isatty(sys.stdout.fileno())


That doesn't say where it's piped though. It could be redirected to a file, or piped to something harmless like jq.


Iterate through /proc/<pid>/fd and check for the pipe id in the symlink target.


The shell would have to give the warning




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: