<?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>dotvoid.com &#187; mail</title>
	<atom:link href="http://www.dotvoid.com/tag/mail/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dotvoid.com</link>
	<description>Experiments and thoughts in PHP and javascript</description>
	<lastBuildDate>Tue, 11 Oct 2011 12:49:15 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Mail form crack attempt</title>
		<link>http://www.dotvoid.com/2005/08/mail-form-crack-attempt/</link>
		<comments>http://www.dotvoid.com/2005/08/mail-form-crack-attempt/#comments</comments>
		<pubDate>Mon, 29 Aug 2005 19:09:30 +0000</pubDate>
		<dc:creator>Danne</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[mail]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://www.commodi.com/?p=142</guid>
		<description><![CDATA[
I recently received two weird email messages. The first one, I could see, came from the contact form here on dotvoid.com. The second looked more like ordinary spam with faked from and to fields. The spam email was however curiously empty of any real content. I soon figured out what was happening. Someone was, successfully, [...]]]></description>
			<content:encoded><![CDATA[<div class="preamble">
<p>I recently received two weird email messages. The first one, I could see, came from the contact form here on dotvoid.com. The second looked more like ordinary spam with faked from and to fields. The spam email was however curiously empty of any real content. I soon figured out what was happening. Someone was, successfully, trying to crack my email form so he could use it to relay spam&#8230;</p></div>
<p>In my contact form I only let the visitor enter two fields, a message and his email address. The user supplied email address is then used to set the From header in the email that is going to be generated. The To header in the email is set to a hard coded &#8220;secret&#8221; value by the script.</p>
<p>Obviously I was sloppy when I created the contact form. I&#8217;m very much ashamed to admit I was not sanitizing the user entered email address properly. Not sanitizing user input is, as we all know, a disaster waiting to happen.</p>
<p>If you can add a newline/carriage return on the end of any value that is going to be written in the email headers you can also add any email header you would want. In this case  the attacker added Bcc headers. Suddenly my email contact form was effectively functioning as a spam relay.</p>
<p>I again learned the lesson I thought I knew. <span style="font-weight: bold;">Always sanitize user input!</span></p>
<p>More on this particluar issue:</p>
<ul>
<li><a href="http://securephp.damonkohler.com/index.php/Email_Injection">Email injection &#8211; Secure PHP<br />
</a></li>
<li><a href="http://www.anders.com/cms/75/Crack.Attempt/Spam.Relay">Interesting Crack Attempt to Relay Spam</a></li>
</ul>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://www.dotvoid.com/2005/08/mail-form-crack-attempt/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.dotvoid.com/2005/08/mail-form-crack-attempt/&amp;title=Mail+form+crack+attempt" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.dotvoid.com/2005/08/mail-form-crack-attempt/&amp;t=Mail+form+crack+attempt" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.dotvoid.com/2005/08/mail-form-crack-attempt/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.dotvoid.com/2005/08/mail-form-crack-attempt/&amp;title=Mail+form+crack+attempt&amp;summary=%0D%0A%0D%0AI%20recently%20received%20two%20weird%20email%20messages.%20The%20first%20one%2C%20I%20could%20see%2C%20came%20from%20the%20contact%20form%20here%20on%20dotvoid.com.%20The%20second%20looked%20more%20like%20ordinary%20spam%20with%20faked%20from%20and%20to%20fields.%20The%20spam%20email%20was%20however%20curiously%20empty%20of%20any%20real%20content.%20I%20soon%20figured%20out%20what%20was%20happening&amp;source=dotvoid.com" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-plaxo">
			<a href="http://www.plaxo.com/?share_link=http://www.dotvoid.com/2005/08/mail-form-crack-attempt/" rel="nofollow" class="external" title="Share this on Plaxo">Share this on Plaxo</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.dotvoid.com/2005/08/mail-form-crack-attempt/&amp;title=Mail+form+crack+attempt" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Mail+form+crack+attempt+-+File: /data/app/webapp/functions.php<br />Line: 7<br />Message: Too many connections&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.dotvoid.com/2005/08/mail-form-crack-attempt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

