O_MAYEXEC — explicitly opening files for execution
O_MAYEXEC — explicitly opening files for execution
Posted May 12, 2020 4:17 UTC (Tue) by Cyberax (✭ supporter ✭, #52523)In reply to: O_MAYEXEC — explicitly opening files for execution by pabs
Parent article: O_MAYEXEC — explicitly opening files for execution
How is it different from "pip install"?
Posted May 12, 2020 4:31 UTC (Tue)
by NYKevin (subscriber, #129325)
[Link] (4 responses)
Having said all that, bash does not call openat2() on stdin (nor should any remotely reasonable program), so I'm going to say this whole question is moot.
Posted May 12, 2020 4:37 UTC (Tue)
by Cyberax (✭ supporter ✭, #52523)
[Link] (3 responses)
Running "curl | bash" is at least honest about its possible impact.
Posted May 12, 2020 5:27 UTC (Tue)
by NYKevin (subscriber, #129325)
[Link] (1 responses)
I don't dispute that. My point was merely that a smart malware author would probably choose a different host, in practice, most of the time. That is a vastly different claim from "PyPI software is always safe," which I certainly did not say. Rather, my claim is more focused on the possible remediation after a malware event. If you know you got it from PyPI, you can pass that information on to security researchers and authorities, who can then study the malware and make recommendations to others. If you got it from curl | bash, who's to say the site is even still there?
Posted May 12, 2020 5:34 UTC (Tue)
by Cyberax (✭ supporter ✭, #52523)
[Link]
Pretty much the only semi-reliable package source are native Linux distribution packages. And even that is likely borderline.
Posted May 12, 2020 9:41 UTC (Tue)
by ballombe (subscriber, #9523)
[Link]
Posted May 14, 2020 8:43 UTC (Thu)
by mina86 (guest, #68442)
[Link] (2 responses)
For those wondering, the way to guard against that is to wrap the entire script with ‘_() { …; }; |’.
Posted May 14, 2020 16:23 UTC (Thu)
by dkg (subscriber, #55359)
[Link] (1 responses)
Posted May 14, 2020 16:28 UTC (Thu)
by mina86 (guest, #68442)
[Link]
O_MAYEXEC — explicitly opening files for execution
O_MAYEXEC — explicitly opening files for execution
O_MAYEXEC — explicitly opening files for execution
O_MAYEXEC — explicitly opening files for execution
O_MAYEXEC — explicitly opening files for execution
curl | bash provide a correct sense of insecurity while being rather inconvenient. Much less likely to lead to a disaster.
O_MAYEXEC — explicitly opening files for execution
I'm pretty sure you mean to wrap the entire script in:
O_MAYEXEC — explicitly opening files for execution
_() {
[…]
}
_
the trailing pipe doesn't make sense.
O_MAYEXEC — explicitly opening files for execution