Security
Security hardening for Debian
Making the programs in a distribution more resistant to exploits—a process known as hardening—is a fairly common way to reduce the attack surface for the distribution. Many distributions have made an effort in this area, with some adding in an overall security architecture, like AppArmor for SUSE or SELinux for Red Hat and Fedora distributions. Debian is currently looking at enabling some hardening features, potentially throughout a large swath of packages that it distributes. The features being considered and the concerns raised provide an interesting look at the tradeoffs.
A posting to debian-devel-announce regarding hardening features for Lenny started the conversation. Those packages that are most susceptible—network services, packages that parse files from untrusted sources, or those that have been the subject of a security alert—should enable a set of security tools that will help deflect attacks against them. Various attacks rely upon certain characteristics of Linux binaries that allow them to be exploited. By altering the way the binaries are built, those particular threats can be mitigated.
The experimental hardening-wrapper package makes enabling the various toolchain differences as easy as setting DEB_BUILD_HARDENING=1 in the environment. This will change gcc, g++, and ld to use the desired flags when building packages. Each hardening feature can also be disabled separately by setting DEB_BUILD_HARDENING_xyzzy=0 (where xyzzy is the name of a hardening feature) if they cause build or performance problems for a particular package.
The specific features enabled are described in the original posting as well as with more detail on the Debian wiki entry for Hardening. They are:
- using -Wformat to catch printf() family calls that do not have a string literal for the format string which can lead to problems if the argument came from an untrusted source and contains format specifiers.
- using -D_FORTIFY_SOURCE_ to validate glibc calls such as strcpy() when the buffer sizes are known at compile time, which can help stop buffer overflow attacks.
- using -fstack-protector to thwart most stack smashing attacks.
- creating Position Independent Executables (PIE) which facilitates using the Address Space Layout Randomization that is available in some kernels. This makes it difficult for an attacker to have any knowledge of what the addresses for the program's sections will look like.
- using ld -z relro to change certain sections to be read-only once ld has made its modifications while loading the program. This can thwart attacks that try to overwrite the Global Offset Table (GOT).
Many other distributions have already been down this path: Gentoo has a page describing their hardened toolchain, Mark Cox of Red Hat has a detailed look at the evolution of security features in Red Hat and Fedora releases, OpenSUSE has a page about its security features, and so on. There is a price to be paid in binary size, execution speed, and cache behavior for these techniques, but for most environments, where resources are not massively constrained, the cost is worth it. It makes new attacks against those systems more difficult to design, which will make users and administrators sleep a little better at night.
New vulnerabilities
gnatsweb: cross-site scripting
| Package(s): | gnatsweb | CVE #(s): | CVE-2007-2808 | ||||
| Created: | February 6, 2008 | Updated: | February 6, 2008 | ||||
| Description: | From the Debian advisory: "r0t" discovered that gnatsweb, a web interface to GNU GNATS, did not correctly sanitize the database parameter in the main CGI script. This could allow the injection of arbitrary HTML, or javascript code. | ||||||
| Alerts: |
| ||||||
goffice: multiple vulnerabilities
| Package(s): | goffice | CVE #(s): | |||||
| Created: | January 31, 2008 | Updated: | February 6, 2008 | ||||
| Description: | GOffice is vulnerable to buffer overflows and memory corruption in PCRE. If an attacker can convince a user to open specially crafted documents, it may be possible to execute arbitrary code, disclose information or cause a denial of service. | ||||||
| Alerts: |
| ||||||
kazehakase: multiple vulnerabilities
| Package(s): | kazehakase | CVE #(s): | |||||
| Created: | January 31, 2008 | Updated: | April 23, 2008 | ||||
| Description: | The kazehakase web browser is vulnerable to buffer overflows and memory corruption in PCRE. If a remote attacker can convince a user to open specially crafted bookmarks, it can lead to the execution of arbitrary code, denial of service or arbitrary information disclosure. | ||||||
| Alerts: |
| ||||||
kernel: denial of service
| Package(s): | kernel | CVE #(s): | CVE-2007-4130 CVE-2007-6694 | ||||||||||||||||||||||||||||||||
| Created: | February 1, 2008 | Updated: | June 20, 2008 | ||||||||||||||||||||||||||||||||
| Description: | From the Red Hat advisory: A flaw was found in the way the Red Hat Enterprise Linux 4 kernel handled page faults when a CPU used the NUMA method for accessing memory on Itanium architectures. A local unprivileged user could trigger this flaw and cause a denial of service (system panic). A possible NULL pointer dereference was found in the chrp_show_cpuinfo function when using the PowerPC architecture. This may have allowed a local unprivileged user to cause a denial of service (crash). | ||||||||||||||||||||||||||||||||||
| Alerts: |
| ||||||||||||||||||||||||||||||||||
pcre: denial of service
| Package(s): | pcre | CVE #(s): | CVE-2006-7225 CVE-2006-7226 | ||||
| Created: | February 1, 2008 | Updated: | February 6, 2008 | ||||
| Description: | From the CVE entries: Perl-Compatible Regular Expression (PCRE) library before 6.7 allows context-dependent attackers to cause a denial of service (error or crash) via a regular expression that involves a "malformed POSIX character class", as demonstrated via an invalid character after a [[ sequence. Perl-Compatible Regular Expression (PCRE) library before 6.7 does not properly calculate the compiled memory allocation for regular expressions that involve a quantified "subpattern containing a named recursion or subroutine reference," which allows context-dependent attackers to cause a denial of service (error or crash). | ||||||
| Alerts: |
| ||||||
rb_libtorrent: stack overflow
| Package(s): | rb_libtorrent | CVE #(s): | |||||
| Created: | February 4, 2008 | Updated: | February 6, 2008 | ||||
| Description: | From the Fedora advisory: A potential remote exploit was found in the bdecode_recursive routine that could trigger a stack overflow when passed malformed message data. | ||||||
| Alerts: |
| ||||||
xdg-utils: arbitrary command execution
| Package(s): | xdg-utils | CVE #(s): | CVE-2008-0386 | ||||||||||||||||
| Created: | January 31, 2008 | Updated: | February 3, 2009 | ||||||||||||||||
| Description: | From the Gentoo alert: Miroslav Lichvar discovered that the "xdg-open" and "xdg-email" shell scripts do not properly sanitize their input before processing it. A remote attacker could entice a user to open a specially crafted link with a vulnerable application using Xdg-Utils (e.g. an email client), resulting in the execution of arbitrary code with the privileges of the user running the application. | ||||||||||||||||||
| Alerts: |
| ||||||||||||||||||
Page editor: Jake Edge
Next page:
Kernel development>>
