March 21, 2012
This article was contributed by Nathan Willis
The shadow password mechanism was introduced to provide increased
security over the early Unix practice of stored salted-and-hashed passwords
in /etc/passwd — but that fact by no means makes it perfect.
The Openwall security-hardened Linux distribution (better known as Owl) offers its own alternative
called tcb, built around
per-user directories and Blowfish encryption. Recently developer Paweł
Hajdan unveiled a similar project of his own, which utilizes several of
tcb's improvements, but supplies them in what Hajdan hopes is an
easier-to-manage design.
Originally, /etc/passwd contained a hashed version of each
account's password. The file itself was readable by any user, which
enabled features like looking up usernames by their UIDs, and other tricks
unrelated to the passwords themselves. The trouble was that attackers
could calculate hashes offline then compare their results against
/etc/passwd looking for matches. Shadow shuts down that attack
vector by separating the hashed password information into a separate file
that is readable only by trusted processes. In a sense, both tcb and
hardened-shadow take that same approach: separating unrelated
information
further to reduce the potency of attacks.
Taking care of passwords
Openwall's tcb mechanism stores salted-and-hashed passwords in a directory of its own, /etc/tcb/, beneath which there is a separate directory for each user. Each user's directory is owned by that user account, and contains their own private shadow file (e.g., /etc/tcb/linus/shadow) also owned by the user.
Both the per-user directory and its contents are in the auth
group with the SGID bit set for the directory, which provides for
additional password policy enforcement. Namely, the system can grant a
process read-only access to password hashes and the password-changing tools
use each user's private directory as scratch space for the temporary and
lock files required during the process. Openwall maintains that this
set-up eliminates the need for SUID-root binaries altogether.
Apart from the system password-changing utilities, most application
programs access shadow password hashes through either Pluggable
Authentication Modules (PAM) or the Name
Service Switch (NSS) facility. Tcb provides a custom PAM module named
pam_tcb and a corresponding NSS module named libnss_tcb
that supersede their /etc/shadow-based alternatives, such as the
pam_unix module. As a result, migrating from a shadow system to
tcb should be completely transparent to other applications. Openwall
provides its own patched suite of shadow utilities (including login,
useradd, chpasswd, newgrp, and so on) patched to support /etc/shadow in addition to /etc/tcb/*/shadow (configurable via a switch in /etc/login.defs), as well as utilities to convert from shadow to tcb and vice-versa.
But Owl's tcb scheme also involves a change to Glibc, so that the crypt(3) function uses the Blowfish cipher. The existing Glibc crypt() offers MD5, SHA-256, and SHA-512 encryption methods. The tcb version patches in Blowfish support that is "mostly compatible" with OpenBSD's bcrypt. The principle advantage is that Blowfish can be configured to use as many set-up rounds as desired when generating the hash; thus administrators can increase the number of rounds over time to make attacks more and more computationally expensive as processor power increases.
Hardened-shadow
Hajdan calls his package hardened-shadow, which he says is inspired directly by tcb. In a March 14 post to the owl-dev list, Hajdan asks for feedback from people interested in the project as well as help performing a security audit of the code.
Hardened-shadow is a reimplementation of the shadow utilities based on
the original upstream
sources, but supporting a somewhat tcb-like layout. The system uses
/etc/hardened-shadow/, with a separate directory for each user
account. But while tcb only stores a single shadow file for each
account, hardened-shadow adds two more: a shell file and an
aging file. The shell file allows chsh to
modify the user account's default shell without having access to the shadow
file, and aging holds the password expiration fields, which would
eliminate the need for locking if administrators expired passwords before
changing them, according to Hajdan.
In addition, hardened-shadow does not require a patched version of Glibc crypt(), and it supports more PAM options than does pam_tcb. Fans of the Blowfish algorithm might balk at the omission of their favorite cipher, but Hajdan has added a PAM parameter to pam_hardened_shadow that allows one to pass the hash algorithm as an argument. In the standard crypt() scheme, the hash algorithm used is designated by a token surrounded by $ characters — MD5 uses $1$, SHA-256 uses $5$, and so on. Hajdan believes making the PAM module indifferent to the hash algorithm makes the code more useful, so that Owl users can take advantage of Blowfish, while others can use their own cipher — and future-proofs it against new exploits that target particular ciphers.
On the down side, Hajdan admits that his code is currently incompatible with SELinux and with NIS. More importantly, of course, it is brand-new and virtually untested, so he advises against deploying it on any production systems.
Openwall's Alexander Peslyak (aka Solar Designer) offered several reasonable suggestions as feedback to Hajdan's list message. Among them were switching to a common open source license in place of Hajdan's current, custom license text, and building hardened-shadow around pam_tcb rather than implementing yet another PAM module with virtually the same goals. Hajdan's reply was that he felt pam_tcb's reliance on a patched Glibc made for too many packages, and that pam_tcb duplicated too many functions already found elsewhere in the tcb library.
Nevertheless, Peslyak said that Openwall would consider migrating to hardened-shadow's version of the shadow utilities (although not the PAM and NSS modules). The reason he gave was that Openwall currently maintains its patch set against a suite of tools that come from a blend of two different sources: the canonical shadow utilities, and a PAM-based implementation called SimplePAMApps. SimplePAMApps, however, is no longer being actively maintained. Owl and a few other distributions curate their own packages of it, but in the long run, synchronizing with an actively developed tool set is probably less work.
The shadowy future
Back in 2010, Hajdan submitted patches to the shadow utilities to enable optional support for tcb, a change that appears to have landed in the 4.1.5 release from February 2012. Nevertheless, tcb is still an essentially Owl-only tool. There does not seem to be much interest in packaging it among the large, "mainstream" distributions; in 2006 the idea was floated on the fedora-devel list where it was met with skepticism.
Some of the criticism from 2006 is questionable (for example, the
concern that users could fill up the /etc filesystem by dumping
files into their /tcb/ directories — the group permissions should prevent that), but others, such as requiring new methods for auditing password changes, may be more valid. Hardened-shadow does not alleviate all of those concerns, but by virtue of not requiring a patched Glibc, it at least stands a better chance of being packaged by other distributions.
Any hope for widespread deployment, however, will probably still need to
address the SELinux incompatibility in the PAM module — and it will
certainly need to wait for a proper security audit and more sets of eyes
scrutinizing the code.
Shadowed passwords were introduced to split up user
account information in a manner that made security exploits harder. As
both of these projects show, further division holds the possibility of
protection against other attacks.
Neither tcb nor hardened-shadow is a perfect solution, of course, but the existing shadow system is far from flawless, too, which is part of what makes a fresh re-examination of it such an interesting exercise.
Comments (34 posted)
Brief items
“We wouldn’t share this with Google for even $1 million,” says [Vupen's Chaouki] Bekrar. “We don’t want to give them any knowledge that can help them in fixing this exploit or other similar exploits. We want to keep this for our customers.”
Those customers, after all, don’t aim to fix Google’s security bugs or those of any other commercial software vendor. They’re government agencies who purchase such “zero-day” exploits, or hacking techniques that use undisclosed flaws in software, with the explicit intention of invading or disrupting the computers and phones of crime suspects and intelligence targets.
--
Forbes
on security research firms selling exploits to governments
The more complicated answer is that many bad things can happen if your RNG breaks down, and some are harder to deal with than others.
In the rest of this post I'm going to talk about this, and give a few potential mitigations. I want to stress that this post is mostly a thought-exercise. Please do not re-engineer OpenSSL around any of the 'advice' I give herein (I'm looking at you, Dan Kaminsky), and if you do follow any of my advice, understand the following:
When it all goes terribly wrong, I'll quietly take down this post and
pretend I never wrote it.
--
Matthew
Green
[An] otherwise uninteresting
article on Internet threats to public infrastructure contains this paragraph:
At a closed-door briefing, the senators were shown how a power company employee could derail the New York City electrical grid by clicking on an e-mail attachment sent by a hacker, and how an attack during a heat wave could have a cascading impact that would lead to deaths and cost the nation billions of dollars.
Why isn't the obvious solution to this to
take those critical electrical grid computers off the public Internet?
--
Bruce
Schneier
Comments (8 posted)
The CyanogenMod project has
announced that
access to the root account will be disabled by default on CM9 installs.
"
Shipping root enabled by default to 1,000,000+ devices was a gaping
hole. With these changes we believe we have reached a compromise that
allows enthusiasts to keep using root if they so desire but also provide a
good level of security to the majority of users."
Comments (8 posted)
New vulnerabilities
chromium, v8: multiple vulnerabilities
| Package(s): | chromium, v8 |
CVE #(s): | CVE-2011-3031
CVE-2011-3032
CVE-2011-3033
CVE-2011-3034
CVE-2011-3035
CVE-2011-3036
CVE-2011-3037
CVE-2011-3038
CVE-2011-3039
CVE-2011-3040
CVE-2011-3041
CVE-2011-3042
CVE-2011-3043
CVE-2011-3044
CVE-2011-3046
CVE-2011-3047
|
| Created: | March 16, 2012 |
Updated: | November 7, 2012 |
| Description: |
From the openSUSE advisory:
Critical CVE-2011-3047: Errant plug-in load and GPU
process memory corruption
Critical CVE-2011-3046: UXSS and bad history navigation.
High CVE-2011-3031: Use-after-free in v8 element
wrapper.
High CVE-2011-3032: Use-after-free in SVG value
handling.
High CVE-2011-3033: Buffer overflow in the Skia
drawing library.
High CVE-2011-3034: Use-after-free in SVG document
handling.
High CVE-2011-3035: Use-after-free in SVG use handling.
High CVE-2011-3036: Bad cast in line box handling.
High CVE-2011-3037: Bad casts in anonymous block
splitting.
High CVE-2011-3038: Use-after-free in multi-column
handling.
High CVE-2011-3039: Use-after-free in quote handling.
High CVE-2011-3040: Out-of-bounds read in text
handling.
High CVE-2011-3041: Use-after-free in class attribute
handling.
High CVE-2011-3042: Use-after-free in table section
handling.
High CVE-2011-3043: Use-after-free in flexbox with
floats.
High CVE-2011-3044: Use-after-free with SVG animation
elements.
|
| Alerts: |
|
Comments (none posted)
gif2png: code execution
| Package(s): | gif2png |
CVE #(s): | CVE-2010-4695
|
| Created: | March 16, 2012 |
Updated: | March 21, 2012 |
| Description: |
From the Gentoo advisory:
The patch for CVE-2009-5018 causes gif2png to truncate GIF pathnames
(CVE-2010-4695).
|
| Alerts: |
|
Comments (none posted)
gnash: heap-based buffer overflow
| Package(s): | gnash |
CVE #(s): | CVE-2012-1175
|
| Created: | March 20, 2012 |
Updated: | March 27, 2012 |
| Description: |
From the Debian advisory:
Tielei Wang from Georgia Tech Information Security Center discovered a
vulnerability in GNU Gnash which is caused due to an integer overflow
error and can be exploited to cause a heap-based buffer overflow by
tricking a user into opening a specially crafted SWF file. |
| Alerts: |
|
Comments (none posted)
kernel: multiple vulnerabilities
| Package(s): | kernel |
CVE #(s): | CVE-2012-1146
CVE-2012-1179
|
| Created: | March 19, 2012 |
Updated: | June 1, 2012 |
| Description: |
From the Red Hat bugzilla [1], [2]:
1) There is an issue when memcg unregisters events that were attached to
the same eventfd:
- On the first call mem_cgroup_usage_unregister_event() removes all
events attached to a given eventfd, and if there were no events left,
thresholds->primary would become NULL;
- Since there were several events registered, cgroups core will call
mem_cgroup_usage_unregister_event() again, but now kernel will oops,
as the function doesn't expect that threshold->primary may be NULL.
2) In some cases it may happen that pmd_none_or_clear_bad() is called
with the mmap_sem hold in read mode. In those cases the huge page
faults can allocate hugepmds under pmd_none_or_clear_bad() and that
can trigger a false positive from pmd_bad() that will not like to see
a pmd materializing as trans huge.
A privileged user in the KVM guest can use this flaw to crash the host.
An unprivileged local user could use this flaw to crash the system. |
| Alerts: |
|
Comments (none posted)
libapache2-mod-fcgid: excessive resource consumption
| Package(s): | libapache2-mod-fcgid |
CVE #(s): | CVE-2012-1181
|
| Created: | March 20, 2012 |
Updated: | March 21, 2012 |
| Description: |
From the Debian advisory:
It was discovered that the Apache FCGID module, a FastCGI implementation,
did not properly enforce the FcgidMaxProcessesPerClass resource limit,
rendering this control ineffective and potentially allowing a virtual
host to consume excessive resources. |
| Alerts: |
|
Comments (none posted)
libpng10: code execution
| Package(s): | libpng10 |
CVE #(s): | CVE-2011-3045
|
| Created: | March 19, 2012 |
Updated: | April 2, 2012 |
| Description: |
From the Red Hat bugzilla:
A type conversion flaw leading to an out-of-bounds heap buffer read was found in the way libpng, a library of functions for manipulation PNG image format files, performed expansion of certain iCCP, iTXt, and zTXt PNG image file chunks.
A remote attacker could provide a specially-crafted Portable Network Graphics (PNG) image file, which once opened in an application, linked against libpng, could lead to denial of service or in some cases, execution of arbitrary code with permission of the user running such an application. |
| Alerts: |
|
Comments (none posted)
minitube: insecure tmp file handling
| Package(s): | minitube |
CVE #(s): | |
| Created: | March 16, 2012 |
Updated: | March 21, 2012 |
| Description: |
From the Gentoo advisory:
Tomáš Pružina reported that Minitube does not handle temporary files
securely.
A local attacker could perform symlink attacks to overwrite arbitrary
files with the privileges of the user running the application.
|
| Alerts: |
|
Comments (none posted)
nginx: information disclosure
| Package(s): | nginx |
CVE #(s): | CVE-2012-1180
|
| Created: | March 20, 2012 |
Updated: | April 5, 2012 |
| Description: |
From the Debian advisory:
Matthew Daley discovered a memory disclosure vulnerability in nginx. In
previous versions of this web server, an attacker can receive the content of
previously freed memory if an upstream server returned a specially crafted HTTP
response, potentially exposing sensitive information. |
| Alerts: |
|
Comments (none posted)
openswan: denial of service
| Package(s): | openswan |
CVE #(s): | CVE-2011-2147
|
| Created: | March 16, 2012 |
Updated: | March 21, 2012 |
| Description: |
From the Gentoo advisory:
Improper permissions are used on /var/run/starter.pid and
/var/lock/subsys/ipsec (CVE-2011-2147). |
| Alerts: |
|
Comments (none posted)
pidgin: two denial of service vulnerabilities
| Package(s): | pidgin |
CVE #(s): | CVE-2011-4939
CVE-2012-1178
|
| Created: | March 16, 2012 |
Updated: | March 26, 2012 |
| Description: |
From the Mandriva advisory:
The pidgin_conv_chat_rename_user function in gtkconv.c in Pidgin
before 2.10.2 allows remote attackers to cause a denial of service
(NULL pointer dereference and application crash) by changing a nickname
while in an XMPP chat room (CVE-2011-4939).
The msn_oim_report_to_user function in oim.c in the MSN protocol
plugin in libpurple in Pidgin before 2.10.2 allows remote servers to
cause a denial of service (application crash) via an OIM message that
lacks UTF-8 encoding (CVE-2012-1178). |
| Alerts: |
|
Comments (none posted)
pyfribidi: code execution
| Package(s): | pyfribidi |
CVE #(s): | CVE-2012-1176
|
| Created: | March 21, 2012 |
Updated: | March 21, 2012 |
| Description: |
Pyfribidi suffers from a buffer overflow exploitable via a four-byte Unicode character. |
| Alerts: |
|
Comments (none posted)
python-mwlib: denial of service
| Package(s): | python-mwlib |
CVE #(s): | |
| Created: | March 19, 2012 |
Updated: | March 21, 2012 |
| Description: |
From the Fedora advisory:
It was reported that mwlib suffered from a flaw that could allow a remote attacker to perform a
denial of service attack on a mwlib installation by forcing it to parse a specially-crafted
#iferror magic function. This issue has been resolved in version 0.13.5. |
| Alerts: |
|
Comments (none posted)
rubygem-actionpack: arbitrary HTML or webscript execution
| Package(s): | rubygem-actionpack |
CVE #(s): | CVE-2012-1098
CVE-2012-1099
|
| Created: | March 19, 2012 |
Updated: | May 9, 2012 |
| Description: |
From the Red Hat bugzilla [1], [2]:
1) A cross-site scripting (XSS) flaw was found in the way the String class, used in Ruby on Rails, performed HTML escaping of SafeBuffer objects, when such objects were manipulated directly via '[]' method or other methods, also returning new instances of SafeBuffer object. By using these methods, such newly returned SafeBuffer instances would be inadvertently marked as HTML safe.
If a Ruby on Rails application used SafeBuffer objects this way, a remote
attacker could provide a specially-crafted input, which once processed by such SafeBuffer instance would pass the HTML escaping test without further
filtering, possibly leading to arbitrary HTML or webscript execution.
2) A cross-site scripting (XSS) flaw was found in the way 'select' helper method
of the Ruby on Rails performed HTML escaping of 'select' HTML tag options, when
the tags were created manually. In this case, the select tag values might end
up unescaped. A remote-attacker could provide a specially-crafted input to Ruby
on Rails application, using select tags this way, which potentially resulted
into arbitrary HTML or webscript execution. |
| Alerts: |
|
Comments (none posted)
systemd: removal of arbitrary system files
| Package(s): | systemd |
CVE #(s): | CVE-2012-1174
|
| Created: | March 19, 2012 |
Updated: | March 26, 2012 |
| Description: |
From the Mandriva advisory:
A TOCTOU race condition was found in the way the systemd-logind
login manager
performed removal of particular records related with user session upon
user logout. A local attacker could use this flaw to conduct symbolic
link attacks, potentially leading to removal of arbitrary system files. |
| Alerts: |
|
Comments (none posted)
Page editor: Jake Edge
Next page: Kernel development>>