Re:#include </etc/shadow>
by ajor on Tuesday December 17, 2019 @09:03AM
(#21813482)
Still some workarounds to the slash-stripping:
Is it possible to restrict the compiler's access to only files in "/usr/include" instead? Seems like it'd be hard to cover every case with just pattern matching.
[ Parent
| on HN ]
It would be awesome if you could place restrictions on the compiler, but I don't know of any such features atm. Still, the compilation happens in the container (which is just a default Ubuntu image with a cross compiler in it). I don't know how much information there is to disclose. Not taking it lightly though, I guess I will have to find a way to really handle the preprocessor stuff, but I still want people to be able to include system headers.
Re:#include </etc/shadow>
by blattimwind on Tuesday December 17, 2019 @09:11AM
(#21813560)
> Is it possible to restrict the compiler's access to only files in "/usr/include" instead? Seems like it'd be hard to cover every case with just pattern matching.
chroot into a build environment
Re:#include </etc/shadow>
by sherincall on Tuesday December 17, 2019 @10:04AM
(#21814080)
You can LD_PRELOAD an .so that overrides `open` and family of functions, and drop opens based on a whitelist/blacklist.