[PATCH] SECURITY.md: Document trusted and untrusted inputs
Adhemerval Zanella Netto
adhemerval.zanella@linaro.org
Fri Nov 20 13:13:08 GMT 2026
On 20/11/26 05:29, Florian Weimer wrote:
> * Adhemerval Zanella:
>
>> +The following inputs are untrusted:
>> +
>> +* Data that applications process on behalf of other parties: network data
>> + (including DNS responses), file contents, and the strings that applications
>> + pass to the library for conversion or parsing (for example to `iconv`, the
>> + `scanf` family or `getaddrinfo`). This includes the names of character sets,
>> + which applications often take from the documents or messages they process.
>> +* The environment of an `AT_SECURE` process. The library removes or ignores
>> + variables such as `LD_PRELOAD`, `LD_LIBRARY_PATH`, `GLIBC_TUNABLES`,
>> + `GCONV_PATH`, `LOCPATH` and `NLSPATH` in such processes, and a bug that lets
>> + them take effect is a security bug.
>
> * The current directory of an AT_SECURE process.
Ack, I think CVE-2017-16997 falls in this category. I will add it.
>
> * The installation path of an AT_SECURE process. That is, the directory
> in which the program is installed, and all its parent directories.
Ack, the $ORIGIN in AT_SECURE is expanded mode only as a whole path element, and only
when the result is a trusted directory (CVE-2010-3847, CVE-2011-0536).
>
> * The initial open file descriptors of an AT_SECURE process.
Ack.
>
>> +The following inputs are trusted:
>> +
>> +* The dynamic loader configuration: `/etc/ld.so.conf` and the files it
>> + includes, `/etc/ld.so.cache`, `/etc/ld.so.preload` and `/etc/tunables.conf`.
>> +* Executables and shared objects, including the objects that programs load
>> + with `dlopen`. The section on shared objects, `ldd` and `ldconfig` below
>> + has more details.
>> +* The name service configuration and the databases that the administrator
>> + maintains: `/etc/nsswitch.conf`, the files read by the `files` service (such
>> + as `/etc/passwd`, `/etc/group`, `/etc/hosts` and `/etc/services`),
>> + `/etc/host.conf`, `/etc/nscd.conf`, and directory services such as NIS and
>> + LDAP. The rest of `/etc/resolv.conf`, apart from the values listed above,
>> + is trusted as well.
>
> It is conceivable that otherwise unprivileged users are allowed to edit
> the GECOS field of their user. Users are routinely allowed to change
> their passwords. This applies to the IDM data mentioned below, too.
>
> I would also add:
>
> * Data retrieved from IDM services such as NIS and Hesiod is trusted at
> the protocol level, that is, both the formatting of the data on the
> wire and the data return is trusted.
Ack.
>
> And completely unrelated:
>
> * Information related to buffer length supplied by the kernel, for
> example the return value of successful read and write system calls.
Ack.
>
> * Standard system installation directories as specified at configure
> time (--prefix, --bindir, --libdir etc.).
Ack.
>
>> +Files are trusted only while untrusted users cannot modify them. A program
>> +that directs the library to a file or directory that untrusted users can
>> +modify, for example with `bindtextdomain` or by running `ldconfig` on it,
>> +extends its trust to those users.
>
> I think the first sentence is reversed? I would say that files are
> still treated as trusted regardless of their file permissions and
> ownership.
Yeah, it is confusing as-is. I will rephrase it.
>
>> +The DNS stub resolver does not authenticate responses and an attacker who can
>> +observe or modify the traffic to the configured name servers can supply
>> +arbitrary answers, and this is not a bug in the library. Bugs in the
>> +processing of DNS responses are security bugs.
>
> This overlaps with the IDM suggestion I made above. We probably should
> make an exception regarding malformed DNS data.
Ack.
>
>> +#### Shared objects, ldd and ldconfig
>> +
>> +Loading a shared object runs code from it, such as ELF constructors and IFUNC
>> +resolvers, so the dynamic loader trusts the objects it loads. Bugs triggered
>> +by crafted executables or shared objects are not security bugs, whether the
>> +objects are loaded at startup (through `DT_NEEDED` dependencies, `LD_PRELOAD`,
>> +or `LD_AUDIR`) or with `dlopen` in a process that is not `AT_SECURE`. A bug
>
> LD_AUDIT
Ack.
>
>> +that makes an `AT_SECURE` process load an object from a location that the
>> +invoking user controls, for example through `LD_LIBRARY_PATH`, `LD_PRELOAD`
>> +or `$ORIGIN`.
>
> Incomplete setnence.
Ack.
>
> Overall, these additions are a nice improvement.
Thanks, I will send a v2.
>
> Thanks,
> Florian
More information about the Libc-alpha
mailing list