<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
<?xml-stylesheet type="text/css" href="http://blog.ngas.ch/styles/feed.css"?>


<title type="html">Filed under: security | Pas un Geek en tant que tel</title>
<subtitle type="html">No Geek As Such</subtitle>
<link rel="alternate" type="text/html" href="http://blog.ngas.ch"/>
<link rel="self" type="application/atom+xml" href="http://blog.ngas.ch/archives/security/index-atom.xml"/>
<updated>2011-12-12T21:19:44+01:00</updated>
<author>
<name><a href=&quot;https://plus.google.com/114292582268779510325&quot;>Tonnerre Lombard</a></name>
<uri>http://blog.ngas.ch</uri>
</author>
<id>http://blog.ngas.ch/</id>
<generator uri="http://nanoblogger.sourceforge.net" version="3.4.2">
NanoBlogger
</generator>

<entry>
<title type="html">Trust based PGP key signing</title>
<author>
<name>Tonnerre Lombard</name>
</author>
<link rel="alternate" type="text/html" href="http://blog.ngas.ch/archives/2008/11/29/trust_based_pgp_key_signing/index.html"/>

<id>http://blog.ngas.ch/archives/2008/11/29/trust_based_pgp_key_signing/index.html</id>
<published>2008-11-29T22:31:25+01:00</published>
<updated>2008-11-29T22:31:25+01:00</updated>
<category term="security" />
<category term="chaos" />
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<p>
 As a visitor here at <a href="http://rgb2r.de/">rgb2r</a> is now moving
 to <s>another planet</s> a far-away country, the discussion came up again
 how to do PGP key signing properly. Originally, the requestor asked for
 passport based signing as done on most of the so-called PGP key signing
 parties. However, for the following reasons I will not sign passports
 and don't want passport based signatures.
</p>
<h2>Party signing</h2>
<p>
 In the normal PGP key signing party based approach, all that is required
 to obtain a signature is a passport or identity card. The signer verifies
 that the signee looks like the person on the picture and then signs the
 key. For this, the signer does not have to know or trust the signee.
 The signer then submits the key to a key server and the signee can download
 it from there.
</p>
<p>
 This method allows one to accumulate a lot of signatures over a short
 time, and to extend the network of signatures very quickly. However, it
 contains various flaws:
</p>
<ul>
 <li>There is no trust relation between the signer and the signee, so the
  only thing that is attested by the signature is, that the signee has
  certain similarities with the documents he/she presented.</li>
 <li>However, especially in multinational keysigning parties, these documents
  can rather easily be forged so that an untrained eye cannot detect the
  forgery.</li>
 <li>There may be valid reasons not to want to show one's ID. For example
  if one's in possession of a diplomatic passport, one might not want to
  show it to everybody because it might be met with suspicion, or it might
  compromise the position of the owner of the passport to have everyone
  be aware of the status.</li>
 <li>In some cases, people may have valid reasons not to disclose their
  real names, especially if they're working in IT security, if they are
  political activists or live in a totalitarian regime. But even under
  normal circumstances, it should be accepted if a person does not want
  to disclose his/her real name.<br/>
  Some people are not even known under their real name at all, and thus
  a signature on their real name would be rather pointless.</li>
 <li>The associated addresses need not automatically belong to the
  signee.</li>
</ul>
<p>
 There are probably many more problems this model is arising by its
 lack of trust dependencies or its focus on the passport as the sole
 base of trust, but these are the most apparent which came to mind.
</p>
<h2>Trust signatures</h2>
<p>
 The so-called <i>trust signature scheme</i> follows an entirely different
 dogma. In this scheme, people knowing each other know enough will sign
 each other's key in order to testify that they are willing to testify
 that the signee is known as the person he/she claims to be. This of course
 implies a much greater level of familiarity between the signer and the
 signee.
</p>
<p>
 Note that in this scheme, it is perfectly valid for the signer to sign
 a key belonging to a pseudonym &mdash; if that's what the signee is known
 as. That may sound suspicious to a person who's used to attesting passports,
 but in the end it is much more logical because in the end, the signer
 attests only what he knows about the other person, without relying on
 a paper he cannot verify.
</p>
<p>
 Also, some more unrelated improvements come to play. In order to verify
 UIDs, the signer creates signatures for each individual UID and sends
 these individually to the mail address in the UID, in an encrypted mail.
 Then, the signer deletes the signature from the local keychain again.
 This sounds tedious, but there are good scripts to take care of that,
 such as, for example, <i>caff</i> from the
 <a href="http://pgp-tools.alioth.debian.org/">pgp-tools package</a>.
</p>
<p>
 In this scheme, it is assured that the owner of the UIDs is at least aware
 of the signature that took place, and can decide whether or not to upload
 the signatures. On the other hand, a pseudonymous signer can participate
 without any loss of the trust relationship.
</p>
</div>
</content>

</entry>
<entry>
<title type="html">MacOS 10 security update: cracked up, again</title>
<author>
<name>Tonnerre Lombard</name>
</author>
<link rel="alternate" type="text/html" href="http://blog.ngas.ch/archives/2008/09/17/macos_10_security_update_cracked_up_again/index.html"/>

<id>http://blog.ngas.ch/archives/2008/09/17/macos_10_security_update_cracked_up_again/index.html</id>
<published>2008-09-17T09:30:00+01:00</published>
<updated>2008-09-17T09:30:00+01:00</updated>
<category term="security" />
<category term="programming" />
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<p>
 A number of very bizarre Apple specific vulnerabilities was discovered in
 MacOS 10 and cleaned up in the latest update
 <a href="http://support.apple.com/kb/HT3137">2008-003</a>. Apart from some
 rather old vulnerabilities (well, at least from this year and not from 2005
 this time), there were also a number of goodies which only turned up on
 Apple MacOS systems:
</p>
<ul>
 <li>Overlong PostScript font names(!) overflow the heap and can lead to
  arbitrary code execution. Quite a classic one might say.</li>
 <li>libresolv is updated to the post-CVE-2008-1447 version (see also
  <a href="archives/2008/09/15/CVE-2008-1447_is_still_alive_-_DNSSEC_the_only_way_out/">the analysis</a>).
   Ok. But the update is not declared as a DNS cache poisoning fix but rather
   as a performance problem?!</li>
 <li>By entering LDAP search expressions into the user name field, LDAP users
  can be enumerated if the MacOS authenticates against Active Directory.</li>
 <li>Cached credentials are not always flushed when a vnode is recycled. This
  means that it is not guaranteed that file permissions are actually applied!
  In fact, it is possible that a file is accessed with the permissions
  which had been granted on an entirely different file, resulting in loss
  of permissions or even privilege escalation.</li>
 <li>A race condition in the login window can be abused to log in as any user
  without a password. If an account exists on the system which does not have
  a password, one just needs to log in as that user and log back out and then
  try to log in as a different user. If the race condition is triggered, then
  the login will succeed without any password.</li>
 <li>If an user resets his password using the login window, the old password
  field is not cleared afterwards. This means that a malicious user can
  go to the unattended computer where the password was changed and change it
  again to some password he knows and then log in as the user. (However, it
  might just be easier to log in with no password.)</li>
 <li>OpenLDAP is configured to have slapconfig store its password into a
  world readable file. Apple has quite a history on world readable and
  writable files, but some people never learn.</li>
 <li>The PPP passwords are stored in an unencrypted, world-readable file. Well,
  see above for Apple and world-readable files.</li>
 <li>Time Machine also stores log files from the backup with world readable
  permissions.</li>
 <li>Remote access passwords are truncated to 8 characters. Uhm well. We had
  that problem as well but fixed it in the early 90s.</li>
 <li>The Wiki Server mail archive stores mails unsanitized and thus permits
  cross site scripting. The other Open Source mailing list archives had that
  too but were fixed roughly 10 years ago.</li>
 <li>The file permissions are slightly misrepresented with respect to remote
  access. However, instead of ensuring that remote access permissions are
  applied as intended, Apple added a note stating that this is not the
  case.</li>
</ul>
<p>
 Have a nice MacOS 10.5 and enjoy the future bugs!
</p>
</div>
</content>

</entry>
<entry>
<title type="html">CVE-2008-1447 is still alive - DNSSEC the only way out</title>
<author>
<name>Tonnerre Lombard</name>
</author>
<link rel="alternate" type="text/html" href="http://blog.ngas.ch/archives/2008/09/15/cve-2008-1447_is_still_alive_-_dnssec_the_only_way_out/index.html"/>

<id>http://blog.ngas.ch/archives/2008/09/15/cve-2008-1447_is_still_alive_-_dnssec_the_only_way_out/index.html</id>
<published>2008-09-15T00:46:58+01:00</published>
<updated>2008-09-15T00:46:58+01:00</updated>
<category term="security" />
<category term="network" />
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<p>
 With a lot of noise, <a href="http://www.doxpara.com/">Dan Kaminsky</a>
 <a href="http://www.doxpara.com/?p=1185">released the security flaw in the
  DNS protocol</a> now known as
  <a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-1447">CVE-2008-1447</a>.
</p>
<p>
 The vulnerability is basically a lack of entropy in the XIDs which are
 used to differenciate between the different responses and to associate
 them with the corresponding queries. The DNS protocol allows additional
 information to be submitted in a response which was not asked for, for
 example if a CNAME is resolved, the corresponding A record which is
 pointed to may be returned in an additional section. This record is then
 learned by the DNS resolvers and will be returned on the next request,
 instead of querying the servers again.
</p>
<p>
 Since the XIDs are rather short, an attacker can send DNS responses with
 various XIDs in order to poison the DNS cache with arbitrary information.
 Hosts querying the poisoned host names during the TTL will then receive
 the fake record and connect to an entirely wrong server.
</p>
<h2>All my useless advice</h2>
<p>
 Back in 2003, <a href="http://cr.yp.to/djb.html">Dan Bernstein</a>
 already published <a href="http://cr.yp.to/djbdns/forgery.html">information
  about the vulnerability</a>, only making slightly less noise than Kaminsky.
 According to his assessment, and to
 <a href="http://www.hackszine.com/blog/archive/2008/07/djbdns_dns_exploits_bernstein.html">public
  perception</a>, the port randomization performed by DJBDNS already
 protected against the poisoning attack. Thus, the ISC released a
 new bind version 9.5.0-P2 which also introduced port randomization,
 causing all of the various NAT problems already known from the FTP.
</p>
<p>
 However, shortly thereafter, someone put up to actually calculate the
 odds of the attack with port randomization, and found that the birthday
 paradoxon actually decreased the complexity of the attack significantly.
 Shortly thereafter, an <a href="http://www.milw0rm.com/exploits/6236">exploit
  for port randomized DNS</a> was released, showing that the port
 randomization was
 <a href="http://tservice.net.ru/~s0mbre/blog/2008/08/08/">not a solution
  to the problem</a>. This leaves DJBDNS vulnerable, too.
</p>
<h2>DNSSEC &ndash; the only way out?</h2>
<p>
 Apparently, only one solution is available so far which really solves the
 problem: the <a href="http://www.dnssec.net/">DNS security extension</a>
 <a href="http://www.rfc-archive.org/getrfc.php?rfc=4034">DNSSEC (RFC4034)</a>.
 DNSSEC signs the zone with SHA1 and an RSA key. The complexity of forging
 this signature is significantly higher.
</p>
<p>
 The disadvantage of DNSSEC is that all zones must be re-signed either on
 update (not so problematic) or every 30 days (harder to implement), or
 otherwise their content will be lost until a new signature is generated.
 Once one manages to automate this step, however, DNSSEC is really useful.
</p>
<p>
 The ISC has prepared a
 <a href="http://www.isc.org/sw/bind/docs/DNSSEC_in_6_minutes.pdf">little
  guide</a> to help people implementing DNSSEC in 6 minutes &ndash; and
 that's already all that's required. However, DJB hates DNSSEC due to
 the amout of CPU time used to verify the signature, and thus did not
 implement it. Salvation can probably be achieved by creating a DNSSEC
 signed zone and converting it to a djbdns zone using the zone conversion
 tool.
</p>
<p>
 PowerDNS also supports storage of DNSSEC records, but cannot create them
 or sign zones in any way. The only way to achieve it is again to sign
 a bind zone and to convert it. The same applies to MaraDNS: there are
 simply no DNSSEC tools available.
</p>
<h2>Spreading the FUD</h2>
<p>
 Nevertheless, <a href="http://blogs.zdnet.com/security/?p=1562">various
  sources</a> are still suggesting that DNSSEC does not help to prevent
 the attack, and that only source port randomization yielded salvation.
 Surely, source port randomization does increase the resilience to the
 attack, but the problem remains unresolved.
</p>
<p>
 Only DNSSEC can provide a definitive solution to the spoofing attacks.
 Currently, the lack of a trust infrastructure still reduces this
 protection, since only the host record and the zone signature must be
 spoofed &ndash; which is however already far from feasible.
</p>
<p>
 At the same time, people should stop repeating things which a single
 source told them &ndash; be it Dan Bernstein or Linus Torvalds. No matter
 if these people are idols, their competence is not universal.
</p>
</div>
</content>

</entry>
<entry>
<title type="html">Linus' Misconception of the Security Industry</title>
<author>
<name>Tonnerre Lombard</name>
</author>
<link rel="alternate" type="text/html" href="http://blog.ngas.ch/archives/2008/09/14/linus_misconception_of_the_security_industry/index.html"/>

<id>http://blog.ngas.ch/archives/2008/09/14/linus_misconception_of_the_security_industry/index.html</id>
<published>2008-09-14T13:48:53+01:00</published>
<updated>2008-09-14T13:48:53+01:00</updated>
<category term="security" />
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<p>
 Ever since the <small>(in-)</small>famous
 <a href="http://article.gmane.org/gmane.linux.kernel/706950">Monkey Story</a>,
 a new anti-security attitude appears to spread among people. Some of the
 Linus-loyalists started promoting a new attitude of not adhering to the
 principles of regular security updates and releasing advisories. At the
 same time, the security industry is worried to see these attitudes fueled
 by the leader of one of the biggest Open Source communities.
</p>
<h2>The general perception of security</h2>
<p>
 We had been facing the attitude of security repudiation before from IT
 consumers, especially in the Windows world there is an attitude of
 security ignorance. Security patches are not applied regularly because
 they are perceived as an annoyance rather than a gain.
</p>
<p>
 The biggest enemy of the security consultant is the perception of
 &rdquo;Who would want to attack me anyway? I am not interesting.&ldquo;
 This may have been a valid question in the very early days of computer
 science, when attacks were conducted by attackers seeking information
 or kids seeking internet access through wardialing into the mainframes
 of the planet.
</p>
<p>
 But the type of &rdquo;end users&ldquo; of security problems has changed
 significantly. Nowadays, the biggest use case of exploits are spambots,
 automatted attacking bots which break into any computer in its way in
 order to use it for spamming other people or conducting denial of service
 attacks for paid customers. To these bots, the average user with his
 innocent PC behind a small line becomes as much of a high class target
 as the rest of the world.
</p>
<p>
 The same applies to server security. The good news is that a lot of the
 time, attackers no longer search for credit card information (which
 is nowadays usually no longer received directly by the web shop where
 people buy their goods but on a server from a trusted credit card
 service provider who has a real security response team &ndash; well, at
 least some of the time). The bad news is that people who react slowly are
 going to lose their ability to send mail by ending up on a blacklist.
</p>
<p>
 And so people also don't care that distributions like
 <a href="http://www.ubuntu.com/">Ubuntu</a> have (besides other problems)
 a 3 month lag in terms of security updates, while other comfortable
 end user distributions like <a href="http://www.fedoraproject.org/">Fedora</a>
 usually release their patches a couple of hours after the incident.
</p>
<h2>Where Linus comes in</h2>
<p>
 The unfortunate step in Linus' new-found
 <a href="http://www.itwire.com/content/view/20046/53/1/1/">tendency to
  security populism</a> is that in this atmosphere of negligence, he fueled
 the argument that &rdquo;security is not important&ldquo;. Possibly this is
 not really what he meant. As it has been proven most impressively by
 <a href="http://www.thinkgeek.com/books/nonfiction/38b2/">Linus' book
  &rdquo;Just for Fun&ldquo;</a>, we are nowadays facing a large crowd of
 people who believe every word Linus says and who will just repeat his
 opinion rather than building their own one. To these people, when Linus
 says &rdquo;security is not important&ldquo;, security will no longer
 be of any importance.
</p>
<p>
 Also, Linus has managed to harm the attitude of open disclosure of the
 various vendors significantly. Since not a lot of vendors really understand
 the way in which security incidents are handled &ndash; which is mostly
 done by the first distributor who gets involved &ndash; Linus' argumentation
 of giving the script kiddies a headstart appears plausible to them. Thus,
 security problems are not necessarily disclosed publically anymore.
</p>
<p>
 However, this principle does not necessarily work, especially for the Linux
 kernel. Due to the development model of the Linux kernel, most of the
 latest releases of the kernel are behaving very unstable and break
 features such as suspend to RAM or virtual machines rather frequently.
 Due to the outlined policy of imposing the burden of fixing these problems
 on the distributor, that is not really a problem, since the distributors
 will usually choose older kernel releases and backport fixes and other
 required features such as new drivers to that version as necessary.
</p>
<p>
 This means however that the vast majority of people is not running the
 latest Linux kernel release. Some depend on their distributor's release,
 and some run older releases which &rdquo;work for them&ldquo;, not knowing
 that there are hidden security holes in that release. Why? Because Linus
 thinks that security is not important.
</p>
<p>
 At the same time, spammers have an army of people fitting the description
 of a monkey more closely than the OpenBSD developers. This army harvests
 the source code and change logs of the Linux kernel for exploitable
 security problems for use in their spam bots. This is a manpower of cheap
 chinese and east europeans which most distributors and end users simply
 don't have. This means that Linus' proclaimed security policy gives
 script kiddies and spammers a headstart over the end user.
</p>
<h2>What Linus did not understand</h2>
<p>
 The most convincing of Linus' arguments remains however to the end user,
 which is, how does one ensure that end users will receive a patch before
 the spammers had a chance to modify their bots? It appears to an outsider
 that this problem remains unresolved. This is however not the case. And
 this is where the <s>masturbating monkey industry</s> security industry
 comes in.
</p>
<p>
 Just like the software itself, a security advisory also has a release
 cycle. For the reasons outlined before, this cycle does not even
 necessarily involve the vendor. The usual procedure is as follows:
</p>
<p>
 Someone discovers a vulnerability and reports it to the vendor. Then,
 the vendor or that someone contacts a CVE member, e.g. a distributor
 such as Debian, Redhat, or whomever. Alternatively, the distributor
 sees the patch for the security problem and picks it up.
</p>
<p>
 Then, the distributor creates a ticket at
 <a href="http://cve.mitre.org/">CVE</a>. Now, all CERTs and distributors
 of the world are aware of the problem. A patch is developed and the
 CVE members set a deadline until when all distributions must have the
 fix. CVE members fix the vulnerability and report their progress through
 a language called <a href="http://oval.mitre.org/">OVAL</a>.
</p>
<p>
 Once every vendor has released a fix, the advisory is made public. Now,
 the CVE switches state from &rdquo;draft&ldquo; to &rdquo;public&ldquo;
 and becomes readable on the CVE web site. (Before this point, the
 identifier shows up as assigned but people visiting the site cannot
 read it.) Distributors release their advisories, and advisoriy outlets
 such as <a href="http://secunia.com/">Secunia</a> pick them up. Only
 now do spammers have access to the advisory, while end users already
 have picked up the fix.
</p>
<p>
 So the problem Linus sees with the &rdquo;obsessive security industry&ldquo;
 is already solved, all that needs to be done is to report security problems
 to at least one of the distributors. Starting from this point, Linus could
 go on taking care of the development cycle.
</p>
</div>
</content>

</entry>
<entry>
<title type="html">New rt for pkgsrc!</title>
<author>
<name>Tonnerre Lombard</name>
</author>
<link rel="alternate" type="text/html" href="http://blog.ngas.ch/archives/2008/08/24/new_rt_for_pkgsrc/index.html"/>

<id>http://blog.ngas.ch/archives/2008/08/24/new_rt_for_pkgsrc/index.html</id>
<published>2008-08-24T02:01:08+01:00</published>
<updated>2008-08-24T02:01:08+01:00</updated>
<category term="security" />
<category term="news" />
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<p>
 After a request from
 <a href="http://pgp.cs.uu.nl/stats/5E0DEBA7.html">Dan</a>, I upgraded
 rt to the new version 3.8, and was slightly surprised. Apart from the
 new interface which finally looks like the MacOS 10 user interface,
 just like all web applications attempt to these days, and the rich text
 mail editor &mdash; a feature I am hoping never to see in action &mdash;
 it also features a whole new set of user configuration options, and, even
 better, PGP support.
</p>
<p>
 Also improved is the SPAM filtering support. It is no longer necessary
 now to prefix rt-mailgate with procmail. Usability is also massively
 improved, the menu is now on the left again rather than on the top.
 Only submenus open on top. The annoying thing is though that in
 menus of a certain depth, the menu bar jumps between top and left
 for the same menu since the top bar only ever shows the topmost
 level.
</p>
<p>
 People who are afraid of wearing glasses can now also configure font
 sizes at will.
</p>
<p>
 So it is time to congratulate <a href="http://www.bestpractical.com/">Best
  Practical</a> to their new release, and to look forward to deploying the
 new PGP feature.
</p>
</div>
</content>

</entry>
<entry>
<title type="html">OpenBSD CVSweb or how not to fix XSS</title>
<author>
<name>Tonnerre Lombard</name>
</author>
<link rel="alternate" type="text/html" href="http://blog.ngas.ch/archives/2008/08/23/openbsd_cvsweb_or_how_not_to_fix_xss/index.html"/>

<id>http://blog.ngas.ch/archives/2008/08/23/openbsd_cvsweb_or_how_not_to_fix_xss/index.html</id>
<published>2008-08-23T19:23:26+01:00</published>
<updated>2008-08-23T19:23:26+01:00</updated>
<category term="security" />
<category term="programming" />
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<p>
 A while ago, a
 <a href="http://www.openbsd.org/cgi-bin/cvsweb/src/?sortby=%22%3E%3Ch1%20style=%22position:absolute;top:10px;font-size:150pt%22%3E%3Cblink%3EOnly%202%20Remote%20bugs%3C/blink%3E%3C/h1%3E">Cross
  Site Scripting (XSS) vulnerability</a> had been found in CVSweb, as used
 by the <a href="http://www.openbsd.org/cgi-bin/cvsweb/">OpenBSD Project</a>.
</p>
<h2>XSS basics</h2>
<p>
 Now, the name <i>Cross Site Scripting</i> may potentially be very misleading.
 In fact the problem is that you can insert arbitrary HTML code into the
 web site. This also means you can fake information displayed in the site;
 thanks to CSS and related tricks, no JavaScript is required for this anymore.
 The term <i>Cross Site Scripting</i> actually comes from the one possible
 scenario where JavaScript code is injected into the web site which can do
 arbitrary things, even send requests back to the web server of an attacker,
 e.g. with the password from some login page.
</p>
<p>
 However, this is just one possible scenario. In any case, fake information
 can be injected into the web site to make it appear as something different.
</p>
<p>
 The correct fix is of course to encode user input properly before displaying
 it on the web site, just like it's done with user input meant to be used
 in SQL statements (in <i>SQL injection</i> attacks, this is not done
 properly). Normally, languages used to design web applications already
 provide means to encode user input for use in web sites; for example,
 Perl has
 <a href="http://search.cpan.org/dist/HTML-Parser/lib/HTML/Entities.pm"><i>encode_entities()</i></a>
 in the
 <a href="http://search.cpan.org/dist/HTML-Parser/"><i>HTML::Parser</i></a>
 package.
</p>
<p>
 <small>(For more information on Cross Site Scripting, please refer to my
  <a href="http://events.ccc.de/congress/2007/Fahrplan/events/2344.en.html">lecture
   about common security problems</a> at the
   <a href="https://events.ccc.de/congress/">Chaos Communication Congress</a>
</p>
<h2>OpenBSD's fix</h2>
<p>
 Rather than to encode the input in question properly and to verify its
 validity, the OpenBSD people decided to go a very unconventional (and
 useless) way in fixing the problem. A JavaScript was added to the web site
 redirecting to <a href="http://bofh.ucs.ualberta.ca/javascript-sucks.html">a
  web site stating that JavaScript sucks</a>. This web site goes on to state:
</p>
<div style="border-color: black; border-width: 3px; border-style: dashed; background-color: #333333; padding-left: 15px; padding-right: 15px;">
 <h3>Javascript Just Sucks</h3>
 <p>
  CVSweb takes input to a cgi script to show you source code, which it
  sanitizes to protect itself. It doesn't care how insecure your web browser is.
 </p>
 <p>
  Nothing on www.openbsd.org cares about Cross Site Scripting, since we
  don't use cookies or any form of authentication. However since your
  web browser will accept script calls in a url that some idiot could
  send you URL with a script embedded in it to make your browser go
  somewhere else from a url that starts with www.openbsd.org. Somehow
  the XSS wankers feel this affects openbsd.org's street
  cred. Mystifying to me, since if you decide to visit this site with a
  web browser that does <tt>rm -rf /</tt> every time your browser sees
  the word "elephant" - well you just got pwned too.. The problem is
  your browser.
 </p>
 <p>
  Of course to remove all special chars in input fields for cvsweb
  means you can't look for interesting stuff in code. So, someday I
  might take the time to try to do that, without making cvsweb useless.
  In the meantime, just turn off javascript when visiting this site, use
  a browser that doesn't support it, or use the
  <a href="https://addons.mozilla.org/en-US/firefox/addon/722">firefox
   noscript extension</a>
  and you'll see cvsweb just fine, once you revisit it at
  <a href="http://www.openbsd.org/cgi-bin/cvsweb">http://www.openbsd.org/cgi-bin/cvsweb</a>
 </p>
</div>
<p>
 The claim that the problem is only in the browser is of course entirely
 wrong. The web site contains additional information which is not supposed
 to be there, and the browser cannot tell the difference between wanted
 and unwanted content. If the input is not properly sanitized, this of
 course means that the browser will interprete it wrong.
</p>
<p>
 If, for example, you visit the above link with JavaScript disabled, you
 will still see the headline &rdquo;Only 2 Remote bugs&ldquo; which
 clearly does not belong there. The fix is not working.
</p>
</div>
</content>

</entry>
<entry>
<title type="html">A rant: Security is not war</title>
<author>
<name>Tonnerre Lombard</name>
</author>
<link rel="alternate" type="text/html" href="http://blog.ngas.ch/archives/2008/07/25/a_rant_security_is_not_war/index.html"/>

<id>http://blog.ngas.ch/archives/2008/07/25/a_rant_security_is_not_war/index.html</id>
<published>2008-07-25T20:45:20+01:00</published>
<updated>2008-07-25T20:45:20+01:00</updated>
<category term="security" />
<category term="network" />
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<p>
 These days we're living in a world which was stuffed with war, attacks and
 extremists of all sorts. In the one corner we have the islamic terror which,
 thanks to series like <i>Sleepers Cell</i>, can now also be enjoyed from
 the living room. People with the turbans carry around bombs and kill
 millions of people every day. The youths are sniffing anthrax and have
 nothing better to do than to segregate themselves from the community
 only in order to get angry about it and to adhere to extremism.
</p>
<p>
 On the other hand, the communist culture of deportation is still alive.
 Women of all the world are deported to Moscow, there is not a family in
 this world who hasn't at least lost one member to them. The deported
 then have to build nuclear weapons which are specially crafted to attack
 the United States, the holy grail, the center of the prosper world.
 For this reason, a protection shield is being established around Poland,
 Czechia &mdash; not Turkey this time, there have been bad experiences
 with the last attempt.
</p>
<p>
 However, the world of computer security is in no way comparable to it.
 After a recent
 <a href="http://bloggingtom.ch/archives/2008/07/23/sql-injection-attacke-gegen-basler-zeitung/">security
  incident of the <i>Baslerzeitung</i></a>, reports said that
 &ldquo;efforts were made to fend off the attacks&rdquo;. On the bloody
 morning after, one tin soldier rides away.
</p>
<p>
 In truth, the issue was very simple. The software used by the newspaper
 was written poorly and allowed to inject additional web site elements
 (&ldquo;Javascript Injection&rdquo;, apparently through SQL). Rather than
 to line up the tin soldier at the server room, armed with guns to fend
 off the attackers, the newspaper simply patched their software. Starting
 from this point, it doesn't matter how many attackers are running against
 the web site &mdash; it is &ldquo;vaccinated&rdquo; and no longer
 vulnerable to the attack.
</p>
<p>
 It is very questionable if the people who write the type of articles
 quoted by BloggingTom can ever be educated on the issue. It should be
 clarified to them that computer programs are more comparable to dogs
 than to countries. Except to the point that there probably are no
 &ldquo;badly coded dogs&rdquo;.
</p>
</div>
</content>

</entry>
<entry>
<title type="html">Webmin: It is fixed if we say so</title>
<author>
<name>Tonnerre Lombard</name>
</author>
<link rel="alternate" type="text/html" href="http://blog.ngas.ch/archives/2008/07/25/webmin_it_is_fixed_if_we_say_so/index.html"/>

<id>http://blog.ngas.ch/archives/2008/07/25/webmin_it_is_fixed_if_we_say_so/index.html</id>
<published>2008-07-25T05:44:00+01:00</published>
<updated>2008-07-25T05:44:00+01:00</updated>
<category term="security" />
<category term="programming" />
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<p>
 On July 25th I looked a bit into an older <i>Webmin</i> vulnerability,
 hoping to fix it for the older version of webmin shipped in pkgsrc. However,
 as it turned out, CVE-2008-0720 affected &ldquo;almost every single search
 field&raquo;. Looking a bit through the search CGIs I quickly found a
 cross site scripting issue as well as an URL parameter problem, so I
 looked into Webmin 1.400 for fixes where the problem was supposed to be
 fixed.
</p>
<p>
 Being the nice person I am, I created a patch and sent it to the
 webalizer developers. The response was that there was no issue to be
 resolved since the referrer check would most likely catch the issues
 already. Thus, I decided to release information about the issue
 without further verification. The vendor is king, right?
</p>
<p>
 Find the fixes in the current pkgsrc version.
</p>
</div>
</content>

</entry>
<entry>
<title type="html">pkgsrc-security hackathlon</title>
<author>
<name>Tonnerre Lombard</name>
</author>
<link rel="alternate" type="text/html" href="http://blog.ngas.ch/archives/2008/07/13/pkgsrc-security_hackathlon/index.html"/>

<id>http://blog.ngas.ch/archives/2008/07/13/pkgsrc-security_hackathlon/index.html</id>
<published>2008-07-13T12:58:58+01:00</published>
<updated>2008-07-13T12:58:58+01:00</updated>
<category term="security" />
<category term="programming" />
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<p>
 Since <i>agc</i> called for an end of the pkgsrc freeze for the release of
 pkgsrc-2008Q2 tonight at 21:00 UTC, I had to put in a hackathlon to fix
 as many security problems as possible. This is an attempt to keep track
 of them.
</p>
<h2>websvn</h2>
<p>
 pkgsrc has a very old version of WebSVN (1.x, current is 2.0) which
 comes with a whole bunch of cross-site-scripting issues (see also
 <a href="http://http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2007-3056">CVE-2007-3056</a>).
 In order to fix them during the freeze I had to manually patch WebSVN
 because there wasn't enough time anymore to ask for a package upgrade
 of this dimension. Patches were mostly taken from
 <a href="http://websvn.tigris.org/source/browse/websvn?rev=581&view=rev">upstream
  changeset 581</a>. It seems however that both the programming and the
 English skills of the author are subterranean.
</p>
<h2>silc-client</h2>
<p>
 The next item was the silc-client buffer overflow which salo refused to
 fix for more than a year. I had already created patches for it but
 they weren't applied for half a year now, so I decided to just go ahead
 and commit them (especially since wiz suggested so in a prior conversation
 in April). They basically update the silc-client package from 1.0.4.1 to
 1.1.4, which also fixes various character set issues.
</p>
<h2>modular-xorg-server</h2>
<p>
 Then our modular-xorg-server came with various vulnerabilities, namely
 those described in
 <a href="http://bugs.freedesktop.org/show_bug.cgi?id=7447">freedesktop.org bug 7447</a>
 and the
 <a href="http://lists.freedesktop.org/archives/xorg-announce/2008-June/000578.html">release
  notes of xorg-server 1.4.2</a>.
 Applying the patches in question fixed the problems, even though an
 upgrade would not appear to be a bad idea.
</p>
<h2>balsa</h2>
<p>
 For relaxing I took a shot at an old one-liner in balsa.
 <a href="http://bugzilla.gnome.org/show_bug.cgi?id=4743662">Gnome bug
  4743662</a> has a neat little classic buffer overflow which was
 easily fixed by adding a range check to the buffer. Unfortunately my
 10G slice allocated to packages started to run full here; Gnome is
 way too large these days.
</p>
<h2>bacula</h2>
<p>
 The next station was the bacula information disclosure: passwords would
 be passed to various tools through the command line. The
 &rdquo;solution&ldquo; the bacula developers came up with was to document
 the fact. I guess since bacula is mainly a bunch of shell scripts, there
 isn't really a better way either, so I pulled their documentation.
</p>
<h2>vobcopy</h2>
<p>
 A maintainer who clearly doesn't take anything seriously is the maintainer
 of vobcopy. I fixed an insecure temp file creation issue but it was rather
 hard to parse his changelog with all the smileys.
</p>
<h2>Perdition IMAP</h2>
<p>
 Perdition IMAP was another easy one; a buffer overflow check in IMAP
 command tag deparsing had to be rearranged to remain effective if the
 tag contained a NULL byte.
</p>
<h2>pear-MDB2</h2>
<p>
 An encounter I would rather have avoided was pear-MDB2. That little beast
 has an information disclosure vulnerability in the structure of the
 respective drivers, so they all have to be updated individually. This
 was a rather tedious task, and in addition to that it was PHP code...
</p>
<p>
 Worse than that, the package even shipped with an XML file containing
 MD5 sums of all source files et cetera. This made it even harder to patch
 since the package.xml file had to be updated as well with every change,
 and it was a downloaded file.
</p>
<h2>Z shell</h2>
<p>
 The Z shell featured a broken difflog script which created temporary
 files with predictable names. Most distributions simply removed the file
 from the distribution, but I decided to simply throw in a bit of
 <a href="http://search.cpan.org/dist/File-Temp/">File::Temp</a>
 love. The result worked judging from my first small tests.
</p>
<h2>OpenAFS</h2>
<p>
 After I told Gendalia a while ago that she should fix OpenAFS, I did it
 myself now. The fix consisted in an upgrade to a newer version.
</p>
<h2>wyrd</h2>
<p>
 The last one handled today was wyrd, a simple privilege escalation in
 the ocaml code. The patch from
 <a href="http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=466382">Debian
  bug 466382</a> applied well.
</p>
<h2>WIP packages</h2>
<p>
 Some pkgsrc-wip packages needed TODO entries, among those were jetty,
 e2fsprogs and Radiator.
</p>
<h2>Old tickets</h2>
<p>
 A number of tickets were also simply outdated and had to be closed.
 The result of the day:
</p>
<table border="0">
 <thead>
  <tr>
   <th>&nbsp;</th>
   <th><big>Open tickets</big></th>
   <th><big>Stalled tickets</big></th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td><big>Before</big></td>
   <td>113</td>
   <td>27</td>
  </tr>
  <tr>
   <td><big>After</big></td>
   <td>69</td>
   <td>3</td>
  </tr>
 </tbody>
</table>
<p>
 I also left some
 <a href="http://mail-index.netbsd.org/pkgsrc-changes/2008/07/date1.html">crazy
  patterns</a>, not in the sand but in the mailing list archives.
</p>
<h2>pkgsrc-security contest</h2>
<p>
 The current stats in the (not serious) pkgsrc-security contest are:
</p>
<table>
 <thead>
  <tr>
   <th>salo</th>
   <th>tonnerre</th>
   <th>adrianp</th>
   <th>ghen</th>
   <th>wiz</th>
   <th>tron</th>
   <th>joerg</th>
   <th>36 others</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td>2038</td>
   <td>334</td>
   <td>238</td>
   <td>153</td>
   <td>107</td>
   <td>92</td>
   <td>63</td>
   <td>327</td>
  </tr>
 </tbod>
</table>
<p>
 Welcome in life, <a href="http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/?only_with_tag=pkgsrc-2008Q2">pkgsrc-2008Q2</a>!
</p>
</div>
</content>

</entry>
<entry>
<title type="html">Debian OpenSSH key weakness FAQ</title>
<author>
<name>Tonnerre Lombard</name>
</author>
<link rel="alternate" type="text/html" href="http://blog.ngas.ch/archives/2008/05/16/debian_openssh_key_weakness_faq/index.html"/>

<id>http://blog.ngas.ch/archives/2008/05/16/debian_openssh_key_weakness_faq/index.html</id>
<published>2008-05-16T00:41:10+01:00</published>
<updated>2008-05-16T00:41:10+01:00</updated>
<category term="security" />
<category term="news" />
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<p>
 A lot of confusion has turned up about the
 <a href="archives/2008/05/13/Blind_trust_in_valgrind_-_the_Debian_OpenSSL_vulnerability/">OpenSSL
  insecure PRNG vulnerability</a> in Debian and related systems. This is
 an attempt to clear these up.
</p>
<h3>Which distributions were affected?</h3>
<p>
 All distributions which pulled their OpenSSL changes directly from Debian.
 Those are namely:
</p>
<p>
 Debian Etch and Lenny, Ubuntu/Kubuntu/Xubuntu and related, grml,
 <a href="http://www.knoppix.net/wiki/Knoppix_Customizations">Knoppix and
  all living customizations</a> and Univention UCS 2.0. Other Linux
 distributions may also be affected.
</p>
<p>
 Known <u>not</u> to be affected are: Fedora, Debian Sarge, NetBSD, OpenBSD,
 FreeBSD, DragonFlyBSD, MirBSD, Gentoo Linux, Univention UCS 1.x, Red Hat
 Enterprise Linux, OpenSuSE, SuSE Linux Enterprise, CentOS, pfSense,
 m0n0wall, Sun Solaris 10 and prior and OpenSolaris.
</p>
<h3>What exactly is the problem?</h3>
<p>
 Due to a <a href="archives/2008/05/13/Blind_trust_in_valgrind_-_the_Debian_OpenSSL_vulnerability/">slightly
  misguided valgrind warning patch</a>, the only &ldquo;random&rdquo; element
 used in key generation and other random number generation processes by
 Debian was the process ID. Since typical process IDs under Linux range from
 0 to 65'535, there were only 65'536 possible different keys generated by
 the OpenSSL toolchain, also including SSH.
</p>
<p>
 This means specificially that an attacker needs only 65'536 attempts to
 bruteforce a key generated by any Debian tool during this period of time.
 The impact of this depends on the usage of the key: for SSH user keys,
 it means that an attacker can impersonate the affected user and log in
 as the affected user to any system where the key is in the authorized_keys
 file. For keys used for certification and encryption, such as SSH host
 keys and SSL certificates, an attacker can impersonate the affected SSH
 or web server, and can potentially read currently running and recorded
 sessions, depending on the procedure used for session key establishment.
</p>
<h3>How can I figure out if my key was affected?</h3>
<p>
 Debian and Ubuntu have released
 <a href="http://security.debian.org/project/extra/dowkd/dowkd.pl.gz">tools
  for key analysis</a> which scan for patterns of the vulnerable keys by
 connecting to named hosts and looking into user's home directories for
 authorized_keys files which contain the patterns. An updated version of
 OpenSSH for Debian and Ubuntu now ships with a tool to automatically
 discover and refuse the vulnerable keys.
</p>
<h3>My key is affected &ndash; what should I do?</h3>
<p>
 The first point is of course to immediately update the affected packages
 if you use a Debian derived system. Then, generate new SSH keys and replace
 them on all systems where your old SSH keys are located. Replace them
 as well on the servers of this nasty customer who left for the concurrence
 &ndash; imagine what would happen if he found out that you left a vulnerable
 SSH key on his host and that his host was compromitted by your negligence.
</p>
<p>
 All affected OpenSSL certificates should also be revoked immediately. Generate
 new certificates and let them be signed and re-issued through your CA.
 Commercial CAs should let you reissue the certificate with the same Subject
 until the end of the certification period you paid up to. Please note that
 revokation is a critical step here, otherwise people might still impersonate
 your old certificate which might, after all, still be valid.
</p>
<p>
 Then make sure your infrastructure was not taken over by botnets through
 an insecure SSH key. Check for rootkits as well while you're at it. If your
 log host is affected, tough luck.
</p>
<h3>How urgent is this? Will I have to act immediately?</h3>
<p>
 Yes, this item requires your immediate attention as there are already
 <a href="archives/2008/05/15/Botnets_exploiting_the_Debian_SSH_key_generation_weakness/">botnets
  out there</a> which search for accounts with vulnerable SSH keys. The
 question is not &ldquo;Does someone care about me little Internet user?&rdquo;
 &mdash; these bots are out to compromise hosts and to send SPAM and malware
 to other hosts. They don't care if you are an attractive target, they
 attack anything they can find and try to send SPAM with it.
</p>
<h3>I have put my securely generated private SSH user key onto a Debian
 system. Should I replace it?</h3>
<p>
 Yes. On a Debian system, your private key was not safe during the last 2
 years. The system may have been compromitted during that time, or someone
 may even only have been eavesdropping your communication and have gained
 knowledge about your SSH key. You should definitely consider it
 compromitted.
</p>
<h3>I have put my securely generated public SSH user key onto a Debian
 system. Should I replace it?</h3>
<p>
 This depends. If your key is an RSA key, it is not compromitted simply
 by putting the public key onto a server and authenticating against it.
 The SSH 2.0 protocol, as described in RFCs 4252 and 4253, part of the
 token being signed as challenge by the user is the &ldquo;session
 identifier&rdquo;, which is a hash from the key exchange. This effectively
 prevents replay attacks of authentication processes done using a
 non-vulnerable SSH key, because the random material used as challenge
 is not only controlled by the vulnerable SSH host, but also by the
 non-vulnerable client. Thus, the data your SSH key has to sign as a
 challenge is not vulnerable to the weak PRNG of the SSH server, and
 thus cannot compromise your key.
</p>
<p>
 This is however not true for DSA keys. DSA has a weakness when used
 in the Diffie-Hellmann key exchange process, rendering it basically
 uneffective. If the attacker gets hold of the random number used by
 the Debian SSH server in the key exchange process, this can be used
 to calculate the private DSA key from the public key with a complexity
 of 2<sup>16</sup>, being 65'536.
</p>
<h3>Summary</h3>
<ul>
 <li>Change any key pair generated using an affected version of the
  pseudo-random number generator. This applies both to the user and
  host SSH keys, and is of course also valid for certificates.</li>
 <li>If you have used a DSA key or certificate on a host affected by
  the vulnerability, it must be regenerated.</li>
 <li>Assume that all data read from and written to a vulnerable machine
  may be intercepted and/or tampered with, like if no crypto layer had
  been applied in the first place.</li>
 <li>RSA keys used to authenticate to vulnerable hosts are secure.</li>
</ul>
<h3>Acknowledgements</h3>
<p>
 Special thanks for this goes to Steven M. Bellovin, who took the time
 to go through an analysis of this entire process with me and to clear
 up my misunderstandings about the OpenSSH challenge-response procedure.
</p>
</div>
</content>

</entry>

</feed>

