Article View: nl.comp.programmeren
Article #19Re: php header injection
From: Tim Van Wassenhove
Date: Sat, 10 Feb 2007 11:23
Date: Sat, 10 Feb 2007 11:23
47 lines
3054 bytes
3054 bytes
Tim Van Wassenhove schreef:
> flor schreef:
>
>>>> Tim Van Wassenhove schreef:
>>>>> if (strstr($email, "\n") !== FALSE) {
>>>>> header('Location: http://example.com');
>>>>> exit;
>>>>> }
> Ik kan je probleem niet reproduceren:
>
>
> require_once('simpletest/unit_tester.php');
> require_once('simpletest/reporter.php');
>
> function DoesNotHaveNewLine($input) {
> return (strstr($input, "\n") === FALSE);
> }
>
> class TestOfDoesNotHaveNewLine extends UnitTestCase {
> function test1() {
> $input = "mike@example.com";
> $this->assertTrue(DoesNotHaveNewLine($input));
> }
>
> function test2() {
> $input = "mike@example.com\n";
> $this->assertFalse(DoesNotHaveNewLine($input));
> }
>
> function test3() {
> $input = "mi\nbcc:john@example.com\r\n\r\n";
> $this->assertFalse(DoesNotHaveNewLine($input));
> }
> }
Helemaal waterdicht is de techniek niet:
function test4() {
$input =
"sender@anonymous.www%0ACc:recipient@someothersite.xxx%0ABcc:somebloke@grrrr.xxx,someotherbloke@oooops.xxx";
$this->assertFalse(DoesNotHaveNewLine($input));
}
--
Tim Van Wassenhove <url:http://www.timvw.be/>
Technical Details
Message-ID:
<26-dnUtwxpLNNlDYnZ2dneKdnZzinZ2d@scarlet.biz>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.scarlet.biz!news.scarlet.biz.POSTED!not-for-mailReferences:
<_dYxh.329365$zB3.6533177@phobos.telenet-ops.be> <MPG.20326fc52ebe7c7a98a4ff@news.individual.net> <NYmyh.331494$Mn7.6448246@phobos.telenet-ops.be> <q_OdnaaHRsXvFFbYRVnytQA@scarlet.biz> <0Pfzh.1619$Ja1.141448@phobos.telenet-ops.be> <0Sfzh.1624$xg.59451@phobos.telenet-ops.be> <DXfzh.1632$Gg.68676@phobos.telenet-ops.be> <26-dnUhwxpLeN1DYnZ2dneKdnZypnZ2d@scarlet.biz>Show Full Headers
Complete Article Headers
X-Google-Thread: 107324,d41daf92e1d7a0a0 X-Google-Thread: 114bee,d41daf92e1d7a0a0 X-Google-Attributes: gid107324,gid114bee,public X-Google-Language: ENGLISH,ASCII-7-bit Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.scarlet.biz!news.scarlet.biz.POSTED!not-for-mail NNTP-Posting-Date: Sat, 10 Feb 2007 05:24:00 -0600 Date: Sat, 10 Feb 2007 12:23:59 +0100 From: Tim Van Wassenhove <timvw@users.sourceforge.net> User-Agent: Thunderbird 1.5.0.9 (Windows/20061207) MIME-Version: 1.0 Newsgroups: nl.comp.programmeren,be.comp.internet.design Subject: Re: php header injection References: <_dYxh.329365$zB3.6533177@phobos.telenet-ops.be> <MPG.20326fc52ebe7c7a98a4ff@news.individual.net> <NYmyh.331494$Mn7.6448246@phobos.telenet-ops.be> <q_OdnaaHRsXvFFbYRVnytQA@scarlet.biz> <0Pfzh.1619$Ja1.141448@phobos.telenet-ops.be> <0Sfzh.1624$xg.59451@phobos.telenet-ops.be> <DXfzh.1632$Gg.68676@phobos.telenet-ops.be> <26-dnUhwxpLeN1DYnZ2dneKdnZypnZ2d@scarlet.biz> In-Reply-To: <26-dnUhwxpLeN1DYnZ2dneKdnZypnZ2d@scarlet.biz> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <26-dnUtwxpLNNlDYnZ2dneKdnZzinZ2d@scarlet.biz> Lines: 47 NNTP-Posting-Host: 62.235.212.163 X-Trace: sv3-ZNVt6A9ah47Pw+RavHtHcZOXcIP4CRqG5hn/N6PXxC7JVxxzckIv2DxLceBBTzUyyGSTt9tKJkHiLAb!l6CESWCoYENGGiseEBHCSnqONJf+H27TqlqYW18kOloXS6hRRlN3IbXswi6PNZeiJJDxMvI3ci/8!dPjqMidGf1HbbA== X-Complaints-To: abuse@scarlet.be X-DMCA-Complaints-To: abuse@scarlet.biz X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.32