<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Security Viewpoints &#187; Web security</title>
	<atom:link href="http://advosys.ca/viewpoints/category/web-server-security/feed/" rel="self" type="application/rss+xml" />
	<link>http://advosys.ca/viewpoints</link>
	<description>Security, operating systems and the IT industry</description>
	<lastBuildDate>Tue, 31 Aug 2010 13:06:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Sanitizing PHP file uploads</title>
		<link>http://advosys.ca/viewpoints/2009/04/sanitizing-php-file-uploads/</link>
		<comments>http://advosys.ca/viewpoints/2009/04/sanitizing-php-file-uploads/#comments</comments>
		<pubDate>Thu, 09 Apr 2009 19:50:28 +0000</pubDate>
		<dc:creator>D Webber</dc:creator>
				<category><![CDATA[Web security]]></category>
		<category><![CDATA[php security]]></category>
		<category><![CDATA[web application security]]></category>

		<guid isPermaLink="false">http://advosys.ca/viewpoints/?p=330</guid>
		<description><![CDATA[Security folks are often called in at the last stage of a project, after the architecture and development work is finalized, with a mandate to &#8220;secure the system&#8221; just before it goes live. Usually the web code and network architecture can&#8217;t be changed because &#8220;that phase of the project has completed&#8221;, or the app is [...]]]></description>
			<content:encoded><![CDATA[<p>Security folks are often called in at the last stage of a project, after the architecture and development work is finalized, with a mandate to &#8220;secure the system&#8221; just before it goes live.</p>
<p>Usually the web code and network architecture can&#8217;t be changed because &#8220;that phase of the project has completed&#8221;, or the app is from a third party and can&#8217;t be changed. So the safeguards we have left to work with are necessarily band-aids&#8230; things that can be applied to offer some protection that require little or no changes to the network and applications. Usually that means deploying a web application firewall.</p>
<p>I did a vulnerability assessment of one web app that had a PHP-based discussion forum. It allowed users to upload file attachments to postings and upload a profile photo so it would appear beside each message.</p>
<p>Of course, the application accepted anything at all for file uploads&#8230; scripts, executables, malicious PDF and MS Office files, <a title=" Exploring Below the Surface of the GIFAR Iceberg" href="http://www.infosecwriters.com/texts.php?op=display&amp;id=642">GIFARs</a>, you name it, and faithfully spit it back verbatim to every visitor of the site. For various reasons the code couldn&#8217;t be changed, so we had to invent a way to retrofit file upload sanitization. <span id="more-330"></span>Good old <a href="http://www.hardened-php.net/suhosin/">suhosin</a> to the rescue. The suhosin extension can be added to most PHP installations with no side effects, and has a handy optional setting suhosin.upload.verification_script. Point it to a script and all PHP file uploads can be checked server-wide, regardless of what checks (or lack thereof) the PHP apps do themselves.</p>
<h3>The requirement</h3>
<p>The client had to comply with a policy to check all uploads with a virus scanner. They were also concerned about malicious image uploads&#8230; the GIFAR issue was hot at the time, and we filled them in about <a title="US-CERT Windows JPEG component buffer overflow" href="http://www.us-cert.gov/cas/techalerts/TA04-260A.html">image handling flaws</a> pop up frequently in Windows. Malicious or revealing metadata in image files (e.g. comments, EXIF and IPTC) was also flagged as a concern.</p>
<p>Virus scanning was easily accomplished with ClamAV, but being certain that JPEGs were sanitized was trickier. After a bit of investigation we settled on simply converting images to an intermediary format, then converting back to JPEG.</p>
<p>It resulted in a minor loss in quality, but guaranteed the images viewed by other users were free of crafted bytes, metadata, appended data like GIFAR (which also works with JPEGs), and even most steganography.</p>
<h3>The code</h3>
<p>The <a href="http://www.hardened-php.net/suhosin/configuration.html#suhosin.upload.verification_script">suhosin.upload.verification_script</a> can be written in any language. It must be executable by the web server process and print a &#8217;1&#8242; on standard output if the file is okay. Any other output causes the upload to fail.</p>
<p>The verification script is called immediately after a file is uploaded to PHP, but before the PHP app can call move_uploaded_file(). The script gets the temporary name of the uploaded file (same as returned by PHP&#8217;s $_FILES["file"]["name"] ) but no other info such as size or MIME type.</p>
<p>Our verification script scanned all uploads with clamdscan, then used a call to file to determine filetype. JPEGs were then run through <a title="GraphicsMagick" href="http://www.graphicsmagick.org/">GraphicsMagick</a> to convert to BMP and back to JPEG format.</p>
<p>Why BMP? After some testing we determined that was the best available format that handles JPEG color ranges and doesn&#8217;t support metadata.</p>
<p>GraphicsMagick is a fork of the better-known <a title="ImageMagick" href="http://www.imagemagick.org/">ImageMagick</a> that is faster and claims to have fewer bugs (it wouldn&#8217;t help to process potentially malicious files with a library that itself has buffer overflows). Apparently it&#8217;s the library used by <a title="Flikr" href="http://www.flickr.com/">Flikr</a>.</p>
<p>Here&#8217;s a simplified version of the script:</p>
<pre>#!/bin/sh
# EXAMPLE ONLY. NOT FOR PRODUCTION USE.
# Executable locations:
CLAMDSCAN=/usr/local/bin/clamdscan
LOGGER=/usr/bin/logger
FILE=/usr/bin/file
GM=/usr/bin/gm # GraphicsMagic
# Output file locations:
LOGFILE=/var/tmp/php_upload_check-$$.log
QUARANTINE_DIR=/var/tmp

$CLAMDSCAN --quiet --log=$LOGFILE $1
if [ $? -eq 0 ]
then
    # This example can only sanitize JPEG files, so try to
    # verify the file is a JPEG before mangling it:
    if [ `$FILE -bi $1` = 'image/jpeg' ]
    then
        # Convert to BMP then back to JPEG which should
        # remove all comments, EXIF, and IPTC metadata,
        # out-of-range bytes in the image stream, most stego,
        # and any appended payloads (e.g. GIFAR-style JAR
        # archives or regular ZIP files)
        $GM convert jpg:$1 bmp:- | gm convert bmp:- jpg:$1
    fi
    # No more tests. Tell Suhosin the file seems okay:
    echo 1
    rm -f $LOGFILE
    exit 0
fi

# File must not have passed, so preserve it and the log:
mv $1 $QUARANTINE_DIR

#Log the event to syslog:
$LOGGER -t php_upload_check -p authpriv.warn \
    "Malicious PHP upload. Scanlog in $LOGFILE. File in $QUARANTINE_DIR/$1"

# Print '0' to STDOUT to tell Suhosin the file seems bad:
echo 0</pre>
<p>The above script logs bad file events to syslog and preserves the uploaded file and virus scan report so an administrator can troubleshoot problems and verify an attempted attacks.</p>
<p>It&#8217;s straightforward to use this method to retrofitÂ  just about any file upload policy onto a PHP site. It could also be used to resize, rotate, and watermark images. One downside is that a suhosin upload scanner cannot return status messages to the original PHP application. Users will see their upload failed, but not why.</p>
<p>Obviously it&#8217;s better if the web application does validation of file uploads, but too often the only choice available is to use hacks like this.</p>
Copyright &copy; 2012 <a href="http://advosys.ca/">Advosys Consulting Inc.</a>

<p><em>Related posts:</em><ul><li><a href='http://advosys.ca/viewpoints/2006/11/hardening-php-servers-with-suhosin/' rel='bookmark' title='Permanent Link: Hardening PHP servers with suhosin'>Hardening PHP servers with suhosin</a></li>
<li><a href='http://advosys.ca/viewpoints/2007/08/core-grasp-php-sql-injection-prevention/' rel='bookmark' title='Permanent Link: Core GRASP &#8211; SQL injection prevention for PHP'>Core GRASP &#8211; SQL injection prevention for PHP</a></li>
<li><a href='http://advosys.ca/viewpoints/2007/04/month-of-php-bugs-summary/' rel='bookmark' title='Permanent Link: Month of PHP bugs summary'>Month of PHP bugs summary</a></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://advosys.ca/viewpoints/2009/04/sanitizing-php-file-uploads/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OWASP meetings are depressing</title>
		<link>http://advosys.ca/viewpoints/2009/04/owasp-meetings-are-depressing/</link>
		<comments>http://advosys.ca/viewpoints/2009/04/owasp-meetings-are-depressing/#comments</comments>
		<pubDate>Tue, 07 Apr 2009 12:04:47 +0000</pubDate>
		<dc:creator>D Webber</dc:creator>
				<category><![CDATA[Web security]]></category>
		<category><![CDATA[best practice]]></category>
		<category><![CDATA[flash security]]></category>
		<category><![CDATA[rant]]></category>
		<category><![CDATA[web security]]></category>

		<guid isPermaLink="false">http://advosys.ca/viewpoints/?p=341</guid>
		<description><![CDATA[Our local OWASP chapter met last night for a talk on &#8220;rich internet applications&#8221; (meaning Ajax, Flash, MS Silverlight, Adobe AIR etc.). It was grim. The talk (given by this guy) mainly focused on how business logic, passwords and encryption keys are being embedded into client-side Flash applications, under the mistaken assumption that compiled Flash [...]]]></description>
			<content:encoded><![CDATA[<p>Our local <a title="Open Web Application Security Project (OWASP)" href="http://www.owasp.org/">OWASP</a> chapter met last night for a talk on &#8220;rich internet applications&#8221; (meaning Ajax, Flash, MS Silverlight, Adobe AIR etc.).</p>
<p>It was grim. The talk (given by <a href="http://preachsecurity.blogspot.com/">this guy</a>) mainly focused on how business logic, passwords and encryption keys are being embedded into client-side Flash applications, under the mistaken assumption that compiled Flash is an impenetrable black box.</p>
<p>But as we&#8217;ve known for decades, <em>everything</em> client side can be tampered with. Flash in particular can be easily decompiled into original source code, often exposing all manner of vulnerabilities.<span id="more-341"></span></p>
<p>By now most web developers understand basic browser security issues like <a title="Writing Secure Web Applications" href="http://advosys.ca/papers/web/61-web-security.html#hidden">hidden fields aren&#8217;t</a> and Javascript can be viewed and changed by the user. But switch to a client-side environment where the code is &#8220;compiled&#8221; like Java applets, Flash, MS Silverlight or Adobe AIR and many developers reset to a default mindset that seems to be:</p>
<ol>
<li>The &#8220;compiled&#8221; code and data cannot be viewed or altered.</li>
<li>Communications between a &#8220;compiled&#8221; client and the server cannot be viewed or altered.</li>
<li>Only my client can communicate with the server and use it&#8217;s exposed APIs</li>
</ol>
<p>It may be a shocking to learn, but even compiled C code can be decompiled with at least some fidelity to the original source. Bytecode compiled apps like Flash andÂ  Java are much easier: flash apps can be returned to near-original source code with <a title="SWFScan flash decompiler" href="http://www.hp.com/go/swfscan">SWFScan</a>, Java with <a title="Cavaj java decompiler" href="http://www.bysoft.se/sureshot/cavaj/">Cavaj</a> and others. And no need for fancy tools when plain text (e.g. embedded passwords) can be pulled from any binary using the good old Unix <a title="Strings man page" href="http://linux.about.com/library/cmd/blcmdl1_strings.htm">strings</a> command.</p>
<p>Traffic between client and server is easily intercepted with <a title="Paros proxy" href="http://www.parosproxy.org/">Paros</a> or <a title="OWASP Web scarab proxy" href="http://www.owasp.org/index.php/Category:OWASP_WebScarab_Project">WebScarab</a> (yes, even when encrypted by SSL), and these tools are also great for mapping server-side APIs for which an attacker can write their own code to invoke the methods.</p>
<p>AJAX apps are not compiled, but widely-used optimizers like <a title="YUI Compressor" href="http://developer.yahoo.com/yui/compressor/">YUI compressor</a> seem to lead to that &#8220;security through compiler&#8221; mindset. I even had a developer argue the sensitive code in their Javascript library was secure because it was &#8220;stored on the server&#8221; (as an external .js file).</p>
<p>It&#8217;s not just web apps though. I&#8217;ve seen the same assumptions in all fat client code, whether elderly Powerbuilder and Visual Basic apps or the latest .NET, C or C++. However, most of those are deployed in the semi-trusted environment of an organization&#8217;s intranet. Still vulnerable, but at least not exposed to the entire universe.</p>
<p>Is there something special about web development that prevents improvement? Sometime in 1998 I wrote <a title="Writing secure web applications" href="http://advosys.ca/papers/web/61-web-security.html">Writing Security Web Applications</a> and 11 years later the same mistakes are being made, both in regular web applications and &#8220;rich&#8221; ones.</p>
<p>Only now instead of passwords and encryption keys being stored in the clear in hidden form fields and cookies, they&#8217;re embedded in Flash, along with business logic talking directly to internet-exposed server APIs.</p>
<p>As I said, OWASP meetings are depressing.</p>
Copyright &copy; 2012 <a href="http://advosys.ca/">Advosys Consulting Inc.</a>

<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://advosys.ca/viewpoints/2009/04/owasp-meetings-are-depressing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Core GRASP &#8211; SQL injection prevention for PHP</title>
		<link>http://advosys.ca/viewpoints/2007/08/core-grasp-php-sql-injection-prevention/</link>
		<comments>http://advosys.ca/viewpoints/2007/08/core-grasp-php-sql-injection-prevention/#comments</comments>
		<pubDate>Fri, 24 Aug 2007 15:55:11 +0000</pubDate>
		<dc:creator>D Webber</dc:creator>
				<category><![CDATA[Web security]]></category>
		<category><![CDATA[application security]]></category>
		<category><![CDATA[intrusion prevention]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php security]]></category>
		<category><![CDATA[sql injection]]></category>
		<category><![CDATA[web application security]]></category>

		<guid isPermaLink="false">http://advosys.ca/viewpoints/2007/08/core-grasp-php-sql-injection-prevention/</guid>
		<description><![CDATA[SQL injection vulnerabilities are still common in web applications. The damage done when attackers are able to send raw SQL commands through to your database are severe enough that most developers have some idea about avoiding it: using bound parameters and stored procedures rather than the usual method (building an SQL statement by concatenating constants [...]]]></description>
			<content:encoded><![CDATA[<p>SQL injection vulnerabilities are still common in web applications. The damage done when attackers are able to send raw SQL commands through to your database are severe enough that most developers have some idea about <a title="OWASP: Avoiding SQL injection" href="http://www.owasp.org/index.php/Avoiding_SQL_Injection">avoiding it</a>: using bound parameters and stored procedures rather than the usual method (building an SQL statement by concatenating constants and user input into one big string).</p>
<p>At Blackhat this year Core Security released an interesting patch for the PHP source code called <a title="CORE GRASP" href="http://grasp.coresecurity.com/">CORE GRASP</a> that attempts to prevent SQL injection at the parser level. It uses data labeling to track input from untrusted sources then prevents it from reaching the SQL server.<span id="more-164"></span></p>
<p>This is similar to the <a title="Security Issues in Perl Scripts: Perl Taint Mode" href="http://www.developer.com/open/article.php/631331">taint mechanism</a> Perl has used for years. Ruby and other languages provide a similar feature. In Perl with taint checking enabled, a  variable receiving external data is labeled as &#8220;tainted&#8221; and prevented from being used with a list of potentially harmful operations: accessing the file system or network, running shell commands and so on. Any variable receiving content from a tainted variable also becomes tainted. To remove the taint label, a variable must be sanitized by filtering it though a search and replace regular expression. Perl doesn&#8217;t check that the filtering actually removes potentially malicious characters&#8230; just that the developer remembered to do so. Taint mode in Perl is more of a reminder to developers than a highly robust security mechanism.</p>
<p>Looking at <a title="A dynamic technique for enhancing the security and privacy of web applications" href="http://grasp.coresecurity.com/download.php?sd=4">the whitepaper</a>, the technique used by GRASP goes much further than Perl taint. Every character in a variable receives a label, not just the entire variable. Untrusted data is not simply blocked from being sent to the SQL server&#8230; the characters are examined for known SQL metacharacters and allowed through if not in a list of known exploits. GRASP can also work the other way&#8230; database fields for internal use only can be labeled and data originating from them can be prevented from reaching the web browser.</p>
<p>Core describes GRASP as a prototype, not for use in production. Currently it is specific to one version of PHP and only looks for SQL injection attacks against MySQL, not Postgres or MS SQL. The whitepaper describes other attacks this technique could be used to mitigate (XSS, shell injection) but those are not detected by this prototype. On nice thing is that Core claims GRASP does work with <a title="Hardening PHP servers with suhosin" href="http://advosys.ca/viewpoints/2006/11/hardening-php-servers-with-suhosin/">Suhosin</a> .</p>
<p>The technique used by GRASP sounds remarkably similar to the <a title="Precise Taint Checking" href="http://www.cs.virginia.edu/~evans/pubs/infosec05.html">Precise Tainting</a> paper published by researchers at the University of Virginia in 2005: labeling individual characters from untrusted input then checking for malicious content before passing to a vulnerable backend.</p>
<p>Identifying SQL injection inside the PHP engine should be more accurate than protocol-level filtering used by <a title="mod_security web application firewall" href="http://mod_security.org/">mod_security</a> and other web application firewalls, though according to the paper the performance hit is a massive 30%. One day the PHP developers may even implement native taint checking&#8230; legendary SATAN and Postfix developer Wietse Venema <a title="[PHP-DEV] PHP-taint update" href="http://www.mail-archive.com/internals@lists.php.net/msg29878.html">said recently</a> he&#8217;s working on an implementation. Unfortunately the PHP developers have a <a href="http://blog.php-security.org/archives/61-Retired-from-securityphp.net.html">history of rejecting</a> security improvements to PHP.</p>
Copyright &copy; 2012 <a href="http://advosys.ca/">Advosys Consulting Inc.</a>

<p><em>Related posts:</em><ul><li><a href='http://advosys.ca/viewpoints/2007/04/month-of-php-bugs-summary/' rel='bookmark' title='Permanent Link: Month of PHP bugs summary'>Month of PHP bugs summary</a></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://advosys.ca/viewpoints/2007/08/core-grasp-php-sql-injection-prevention/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Port scanning with Adobe Flash</title>
		<link>http://advosys.ca/viewpoints/2007/08/port-scanner-with-adobe-flash/</link>
		<comments>http://advosys.ca/viewpoints/2007/08/port-scanner-with-adobe-flash/#comments</comments>
		<pubDate>Mon, 20 Aug 2007 13:50:56 +0000</pubDate>
		<dc:creator>D Webber</dc:creator>
				<category><![CDATA[Best practices]]></category>
		<category><![CDATA[Web security]]></category>
		<category><![CDATA[adobe flash security]]></category>
		<category><![CDATA[browser security]]></category>
		<category><![CDATA[Malware]]></category>
		<category><![CDATA[port scanning]]></category>
		<category><![CDATA[vulnerabilities]]></category>

		<guid isPermaLink="false">http://advosys.ca/viewpoints/2007/08/port-scanner-with-adobe-flash/</guid>
		<description><![CDATA[The same origin policy for web browsers is completely blown. Last year SPI Dynamics demonstrated how to trick a browser into doing a port scan of the local network using plain old Javascript. Now researchers at the Chaos Communication Camp demonstrated that Adobe Flash can do the same thing. Very neat proof of concept. Yet [...]]]></description>
			<content:encoded><![CDATA[<p>
  The <a href="http://en.wikipedia.org/wiki/Same_origin_policy" title="Same origin policy">same origin policy</a>  for web browsers is completely blown. Last year SPI Dynamics <a href="http://www.spidynamics.com/assets/documents/JSportscan.pdf" title="Detecting, Analyzing, and Exploiting Intranet Applications using Javascript">demonstrated</a>  how to trick a browser into <a href="http://www.gnucitizen.org/projects/javascript-port-scanner/" title="Javascript port scanner">doing a port scan</a>  of the local network using plain old Javascript. Now researchers at the <a href="http://events.ccc.de/camp/2007/Chaos_Communication_Camp_2007" title="Chaos Computer Camp 2007">Chaos Communication Camp</a>  demonstrated that Adobe Flash can <a href="http://scan.flashsec.org/" title="Design flaw in Actionscript 3 socket handling">do the same thing</a>. Very neat proof of concept.
</p>
<p>
  Yet <a href="http://advosys.ca/viewpoints/2007/07/multiple-flash-vulnerabilities/" title="Major new flaw in Adobe Flash Player - Windows, Linux and Mac">another</a> <a href="http://advosys.ca/viewpoints/2006/09/flash-player-vulnerability/" title="Remote exploit in Adobe Flash player"> reason</a>  not to trust Flash content and to run host-based firewalls on your intranet workstations and servers. With flaws like these and problems like <a href="http://crypto.stanford.edu/dns/" title="DNS Rebinding">DNS rebinding</a> , code executed in browsers are no longer limited to accessing their origin server. We can retire the outdated concept of network perimeter.
</p>
<p>
  It&#8217;s not practical to disable Flash, but if you use Firefox or another Mozilla browser, the <a href="http://flashblock.mozdev.org/" title="FlashBlock extension for Mozilla">FlashBlock</a>  extension at least lets you decide which Flash content your browser can execute.</p>
Copyright &copy; 2012 <a href="http://advosys.ca/">Advosys Consulting Inc.</a>

<p><em>Related posts:</em><ul><li><a href='http://advosys.ca/viewpoints/2007/07/multiple-flash-vulnerabilities/' rel='bookmark' title='Permanent Link: Major new flaw in Adobe Flash Player &#8211; Windows, Linux and Mac'>Major new flaw in Adobe Flash Player &#8211; Windows, Linux and Mac</a></li>
<li><a href='http://advosys.ca/viewpoints/2006/09/flash-player-vulnerability/' rel='bookmark' title='Permanent Link: Remote exploit in Adobe Flash player'>Remote exploit in Adobe Flash player</a></li>
<li><a href='http://advosys.ca/viewpoints/2006/09/disarming-adobe-pdf-vulnerabilities/' rel='bookmark' title='Permanent Link: Disarming Adobe PDF Viewer'>Disarming Adobe PDF Viewer</a></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://advosys.ca/viewpoints/2007/08/port-scanner-with-adobe-flash/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>(Unencrypted) site security confirmed!</title>
		<link>http://advosys.ca/viewpoints/2007/08/unencrypted-site-security-confirmed/</link>
		<comments>http://advosys.ca/viewpoints/2007/08/unencrypted-site-security-confirmed/#comments</comments>
		<pubDate>Wed, 08 Aug 2007 02:04:42 +0000</pubDate>
		<dc:creator>D Webber</dc:creator>
				<category><![CDATA[Web security]]></category>
		<category><![CDATA[authentication]]></category>
		<category><![CDATA[DNS]]></category>
		<category><![CDATA[encryption]]></category>
		<category><![CDATA[marketing]]></category>
		<category><![CDATA[phishing]]></category>
		<category><![CDATA[ssl]]></category>
		<category><![CDATA[vulnerabilities]]></category>
		<category><![CDATA[web security]]></category>

		<guid isPermaLink="false">http://advosys.ca/viewpoints/2007/08/unencrypted-site-security-confirmed/</guid>
		<description><![CDATA[SSL vendors still equate encryption with &#8220;security&#8221;. Forget about hardening your e-commerce server. Don&#8217;t bother encrypting data at rest. According to the ads from SSL vendors, all you need is their 128-bit SSL certificate (preferably the new EV SSL variety) &#8230; and to pay the annual fee. VPN and other crypto product vendors do the [...]]]></description>
			<content:encoded><![CDATA[<p>SSL vendors still equate encryption with &#8220;security&#8221;. Forget about hardening your e-commerce server. Don&#8217;t bother encrypting data at rest. According to the ads from SSL vendors, all you need is their 128-bit SSL certificate (preferably the new <a href="http://advosys.ca/viewpoints/2006/10/high-assurance-ssl-certificates/">EV SSL</a> variety) &#8230; and to pay the annual fee.</p>
<p>VPN and other crypto product vendors do the same. They get away with this because to many people, crypto is still <a title="Practical Cryptography - Preface" href="http://www.schneier.com/book-practical-preface.html">magical security dust</a>.</p>
<p>But wait! Did you know you only have to buy the <span style="text-decoration: line-through;">dust</span> SSL certificate, not actually <span style="text-decoration: line-through;">sprinkle it around</span> install it on the server? Magic indeed!<span id="more-160"></span></p>
<p>I learned this recently when someone asked me to check out a little online store. They were about to make a purchase then noticed the credit card entry page began with &#8220;http://&#8221; and the SSL padlock icon was missing.</p>
<p>Not uncommon. Many mom-and-pop sites try to skip the cost of SSL certificates hoping customers either won&#8217;t notice or won&#8217;t mind. However, what was confusing about this unencrypted storefront was that it sported a large &#8220;Verified by GeoTrust&#8221; button.</p>
<p>You&#8217;ve seen these and similar assurance stickers from other SSL vendors (check out Geotrust&#8217;s front page for a live example). Clicking the button pops up a window showing the http URL, company name and the reassuring words &#8220;Site Security Confirmed&#8221;.</p>
<p>Now, it&#8217;s technically possible for a form to originate from an unencrypted URL then submit the data to an SSL URL. However, a quick look at the HTML of this order form revealed the &#8220;action=&#8221; went to the same unencrypted URL and there was javascript or other tricks involved&#8230; the form really was sending card numbers and other private info entirely in the clear. So how could this be &#8220;Security Confirmed&#8221;?</p>
<p>A technical person might expect an SSL verification function to check the http_referer to determine the originating site, verify the URL began with &#8220;https://&#8221;, then retrieve the certificate from the server, verify that it&#8217;s subject Common Name matches the URL and has not expired or been revoked. More thorough checks might include some simple automated auditing and portscans of the server, like &#8220;<a href="http://www.scanalert.com/site/en/certification/howitworks/">Hacker Safe</a>&#8220;.</p>
<p>Too technical, it seems. It appears all this SSL vendor&#8217;s verification button does is:</p>
<ol>
<li>Checks that the button is being displayed on the web site it says it is (using good old unspoofable DNS, of course).</li>
<li>Verify an SSL certificate has been <em>sold</em> to the web site and has not expired or been revoked.</li>
</ol>
<p>The result is a site can be unencrypted and still have &#8220;site security confirmed&#8221;. I guess this means SSL is no longer &#8220;security dust&#8221;&#8230; it&#8217;s graduated to &#8220;security talisman&#8221;. Just possessing an SSL certificate is enough. No need to actually use it.</p>
<p>When we notified the site owners that their order-taking page was unencrypted, they argued that we were mistaken&#8230; previous customers had reported the same thing but the Geotrust button &#8220;confirmed everything was okay&#8221;.</p>
<p>It took some effort to convince them the button was lying. Later it turned out the site did have a valid certificate installed and ready to use, but their web developer had screwed up and used &#8220;http&#8221; instead of &#8220;https&#8221; in the shopping cart app and related URLs. A quick search and replace fixed the issue.</p>
<p>Having the Geotrust button actually <em>reduced</em> the security of this site. The owners trusted what the button said over the tell-tale lack of SSL indicators in their web browser. Probably many customers did the same: noticed the missing SSL then placed orders anyway after being reassured by the button. The situation could have gone on for years.</p>
<p>But what do you want for nothing? The verification button is provided free, right? Actually no&#8230; businesses must pay the SSL vendor extra to be able to use it on their sites.</p>
Copyright &copy; 2012 <a href="http://advosys.ca/">Advosys Consulting Inc.</a>

<p><em>Related posts:</em><ul><li><a href='http://advosys.ca/viewpoints/2006/09/trust-certifications-untrustworthy/' rel='bookmark' title='Permanent Link: Web site trust certifications untrustworthy?'>Web site trust certifications untrustworthy?</a></li>
<li><a href='http://advosys.ca/viewpoints/2006/10/high-assurance-ssl-certificates/' rel='bookmark' title='Permanent Link: High assurance SSL certificates'>High assurance SSL certificates</a></li>
<li><a href='http://advosys.ca/viewpoints/2010/03/dns-security-talk/' rel='bookmark' title='Permanent Link: DNS security talk'>DNS security talk</a></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://advosys.ca/viewpoints/2007/08/unencrypted-site-security-confirmed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Month of PHP bugs summary</title>
		<link>http://advosys.ca/viewpoints/2007/04/month-of-php-bugs-summary/</link>
		<comments>http://advosys.ca/viewpoints/2007/04/month-of-php-bugs-summary/#comments</comments>
		<pubDate>Thu, 12 Apr 2007 15:58:36 +0000</pubDate>
		<dc:creator>D Webber</dc:creator>
				<category><![CDATA[Web security]]></category>
		<category><![CDATA[intrusion prevention]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php security]]></category>
		<category><![CDATA[vulnerabilities]]></category>
		<category><![CDATA[web application security]]></category>

		<guid isPermaLink="false">http://advosys.ca/viewpoints/2007/04/month-of-php-bugs-summary/</guid>
		<description><![CDATA[Well, the &#34;Month of PHP Bugs&#34; has concluded, exposing 41 security issues in the PHP web development language. Some don&#8217;t agree with this method of publishing vulnerabilities, but sometimes it&#8217;s necessary to help developers focus on security. Embarrassment is an highly effective motivator. Personally I think this was sorely need for PHP and Stefan Esser [...]]]></description>
			<content:encoded><![CDATA[<p>Well, the &quot;<a href="http://www.php-security.org/">Month of PHP Bugs</a>&quot; has concluded, exposing 41 security issues in the PHP web development language. Some don&#8217;t agree with this method of publishing vulnerabilities, but sometimes it&#8217;s necessary to help developers focus on security. Embarrassment is an highly effective motivator. Personally I think this was sorely need for PHP and Stefan Esser should be congratulated.</p>
<p>If you haven&#8217;t been following along, Jeff Forristal of SPI Dynamics has written an excellent <a href="http://portal.spidynamics.com/blogs/jeff/archive/2007/04/03/The-current-state-of-PHP-security-_2800_w_2F00_-MOPB-full-review_2900_.aspx">summary of the Month of PHP Bugs</a> on his blog. Well worth reading. He also recommends several compile-time flags and php.ini settings to disable high risk functions, including a couple settings that aren&#8217;t listed by phpinfo() that I wasn&#8217;t aware even existed.</p>
<p>However, as the Month of PHP Bugs has demonstrated, the design of PHP (and quality of most PHP code) is such that disabling specific functions and tweaking php.ini is far from being a complete solution. I strongly recommend also installing the <a href="http://advosys.ca/viewpoints/2006/11/hardening-php-servers-with-suhosin/">Suhosin</a> extensions, sitting your web servers behind an application layer filter such as <a href="http://advosys.ca/viewpoints/2006/10/mod_security-201-released/">mod_security</a>, and of course continually monitoring activity on the network and servers.</p>
Copyright &copy; 2012 <a href="http://advosys.ca/">Advosys Consulting Inc.</a>

<p><em>Related posts:</em><ul><li><a href='http://advosys.ca/viewpoints/2006/11/hardening-php-servers-with-suhosin/' rel='bookmark' title='Permanent Link: Hardening PHP servers with suhosin'>Hardening PHP servers with suhosin</a></li>
<li><a href='http://advosys.ca/viewpoints/2007/08/port-scanner-with-adobe-flash/' rel='bookmark' title='Permanent Link: Port scanning with Adobe Flash'>Port scanning with Adobe Flash</a></li>
<li><a href='http://advosys.ca/viewpoints/2007/08/core-grasp-php-sql-injection-prevention/' rel='bookmark' title='Permanent Link: Core GRASP &#8211; SQL injection prevention for PHP'>Core GRASP &#8211; SQL injection prevention for PHP</a></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://advosys.ca/viewpoints/2007/04/month-of-php-bugs-summary/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

