]> git.ipfire.org Git - thirdparty/glibc.git/blame - SECURITY.md
x86: In ld.so, diagnose missing APX support in APX-only builds
[thirdparty/glibc.git] / SECURITY.md
CommitLineData
f85722f9 1# The GNU C Library Security Policy
c4098bc2 2
f85722f9 3This document describes the policy followed by the GNU C Library maintainers
c4098bc2
SP
4to handle bugs that may have a security impact. This includes determining if a
5bug has a security impact, reporting such bugs to the community and handling
f85722f9 6such bugs all the way to resolution. This policy may evolve over time, so if
c4098bc2
SP
7you're reading this from a release tarball, be sure to check the latest copy of
8the [SECURITY.md in the
9repository](https://sourceware.org/git/?p=glibc.git;a=blob;f=SECURITY.md),
10especially for instructions on reporting issues privately.
11
12## What is a security bug?
13
14Most security vulnerabilities in the GNU C Library materialize only after an
15application uses functionality in a specific way. Therefore, it is sometimes
16difficult to determine if a defect in the GNU C Library constitutes a
17vulnerability as such. The follow guidelines can help with a decision.
18
19* Buffer overflows should be treated as security bugs if it is conceivable that
20 the data triggering them can come from an untrusted source.
21* Other bugs that cause memory corruption which is likely exploitable should be
22 treated as security bugs.
23* Information disclosure can be security bugs, especially if exposure through
24 applications can be determined.
25* Memory leaks and races are security bugs if they cause service breakage.
26* Stack overflow through unbounded alloca calls or variable-length arrays are
27 security bugs if it is conceivable that the data triggering the overflow
28 could come from an untrusted source.
29* Stack overflow through deep recursion and other crashes are security bugs if
30 they cause service breakage.
31* Bugs that cripple the whole system (so that it doesn't even boot or does not
32 run most applications) are not security bugs because they will not be
33 exploitable in practice, due to general system instability.
34* Bugs that crash `nscd` are generally security bugs, except if they can only
35 be triggered by a trusted data source (DNS is not trusted, but NIS and LDAP
36 probably are).
37* The [Security Exceptions](#SecurityExceptions) section below describes
38 subsystems for which determining the security status of bugs is especially
39 complicated.
40* For consistency, if the bug has received a CVE name attributing it to the GNU
41 C library, it should be flagged `security+`.
42* Duplicates of security bugs (flagged with `security+`) should be flagged
43 `security-`, to avoid cluttering the reporting.
44
45In this context, _service breakage_ means client-side privilege escalation
46(code execution) or server-side denial of service or privilege escalation
47through actual, concrete, non-synthetic applications. Or put differently, if
48the GNU C Library causes a security bug in an application (and the application
49uses the library in a standard-conforming manner or according to the manual),
50the GNU C Library bug should be treated as security-relevant.
51
52### Security Exceptions
53
54It may be especially complicated to determine the security status of bugs in
55some subsystems in the GNU C Library. This subsection describes such
56subsystems and the special considerations applicable during security bug
57classification in them.
58
59#### Regular expression processing
60
61Regular expression processing comes in two parts, compilation (through regcomp)
62and execution (through regexec).
63
64Implementing regular expressions efficiently, in a standard-conforming way, and
65without denial-of-service vulnerabilities is very difficult and impossible for
66Basic Regular Expressions. Most implementation strategies have issues dealing
67with certain classes of patterns.
68
69Consequently, certain issues which can be triggered only with crafted patterns
70(either during compilation or execution) are treated as regular bugs and not
71security issues. Examples of such issues would include (but is not limited
72to):
73
74 * Running out of memory through valid use of malloc
75 * Quadratic or exponential behaviour resulting in slow execution time
76 * Stack overflows due to recursion when processing patterns
77
78Crashes, infinite loops (and not merely exponential behavior), buffer overflows
79and overreads, memory leaks and other bugs resulting from the regex
80implementation relying on undefined behavior should be treated as security
81vulnerabilities.
82
83#### wordexp patterns
84
85`wordexp` inherently has exponential memory consumption in terms of the input
86size. This means that denial of service flaws from crafted patterns are not
87security issues (even if they lead to other issues, such as NULL pointer
88dereferences).
89
90#### Asynchronous I/O
91
92The GNU C Library tries to implement asynchronous I/O without kernel support,
93which means that several operations are not fully standard conforming. Several
94known races can cause crashes and resource leaks. Such bugs are only treated
95as security bugs if applications (as opposed to synthetic test cases) have
96security exposures due to these bugs.
97
98#### Asynchronous cancellation
99
100The implementation of asynchronous cancellation is not fully
101standard-conforming and has races and leaks. Again, such bugs are only treated
102as security bugs if applications (as opposed to synthetic test cases) have
103security exposures due to these bugs.
104
105#### Crafted binaries and ldd
106
107The `ldd` tool is not expected to be used with untrusted executables.
108
109#### Post-exploitation countermeasures
110
111Certain features have been added to the library only to make exploitation of
112security bugs (mainly for code execution) more difficult. Examples includes
113the stack smashing protector, function pointer obfuscation, vtable validation
114for stdio stream handles, and various heap consistency checks. Failure of such
115countermeasures to stop exploitation of a different vulnerability is not a
116security vulnerability in itself. By their nature, these countermeasures are
117based on heuristics and will never offer complete protection, so the original
118vulnerability needs to be fixed anyway.
119
f85722f9 120## Reporting security bugs
c4098bc2 121
f85722f9
SP
122The process to report security bugs is documented on the glibc [security
123page](https://sourceware.org/glibc/security.html). In general, most security
124bugs may be reported publicly in the [glibc
125bugzilla](https://sourceware.org/glibc/bugs.html), but if in doubt, please feel
126free to report security issues privately first.
c4098bc2
SP
127
128## Triaging security bugs
129
130This section is aimed at developers, not reporters.
131
132Security-relevant bugs should be marked with `security+`, as per the [Bugzilla
133security flag
134documentation](https://sourceware.org/glibc/wiki/Bugzilla%20Procedures#security),
135following the guidelines above. If you set the `security+` flag, you should
136make sure the following information is included in the bug (usually in a bug
137comment):
138
139* The first glibc version which includes the vulnerable code. If the
140 vulnerability was introduced before glibc 2.4 (released in 2006), this
141 information is not necessary.
142* The commit or commits (identified by hash) that fix this vulnerability in the
143 master branch, and (for historic security bugs) the first release that
144 includes this fix.
145* The summary should include the CVE names (if any), in parentheses at the end.
146* If there is a single CVE name assigned to this bug, it should be set as an
147 alias.
148
149The following links are helpful for finding untriaged bugs:
150
151* [Unprocessed bugs](https://sourceware.org/bugzilla/buglist.cgi?f1=flagtypes.name&o1=notsubstring&product=glibc&query_format=advanced&v1=security)
152* [`security?` review requests](https://sourceware.org/bugzilla/buglist.cgi?f1=flagtypes.name&o1=substring&product=glibc&query_format=advanced&v1=security%3f)
153* [Open `security+` bugs](https://sourceware.org/bugzilla/buglist.cgi?bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=SUSPENDED&bug_status=WAITING&bug_status=REOPENED&bug_status=VERIFIED&f1=flagtypes.name&o1=substring&product=glibc&query_format=advanced&v1=security%2B)
154
155## Fixing security bugs
156
157For changes to master, the regular [consensus-driven
158process](https://sourceware.org/glibc/wiki/Consensus) must be followed. It
159makes sense to obtain consensus in private, to ensure that the patch is likely
160in a committable state, before disclosing an emboargoed vulnerability.
161
162Security backports to release branches need to follow the
163[release process](https://sourceware.org/glibc/wiki/Release#General_policy).
164
165Contact the [website
166maintainers](https://sourceware.org/glibc/wiki/MAINTAINERS#Maintainers_for_the_website)
167and have them draft a news entry for the website frontpage to direct users to
168the bug, the fix, or the mailing list discussions.
169
170## CVE assignment
171
f85722f9
SP
172Security bugs flagged with `security+` should have [CVE
173identifiers](http://cve.mitre.org/about/). Please reach out to the glibc
174security team using the documented [security
175process](https://sourceware.org/glibc/security.html) and they work on getting a
176CVE number.