Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #9925

Re: $referrer = $_SERVER['HTTP_REFERER'] echo

Path csiph.com!usenet.pasdenom.info!news.albasani.net!newsreader4.netcologne.de!news.netcologne.de!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail
Content-Type text/plain; charset="UTF-8"
Message-ID <7348494.GbytuHRu9D@PointedEars.de> (permalink)
From Thomas 'PointedEars' Lahn <PointedEars@web.de>
Reply-To Thomas 'PointedEars' Lahn <php@PointedEars.de>
Organization PointedEars Software (PES)
Date Fri, 28 Jun 2013 21:49:57 +0200
User-Agent KNode/4.10.4
Content-Transfer-Encoding 8Bit
X-Face %i>XG-yXR'\"2P/C_aO%~;2o~?g0pPKmbOw^=NT`tprDEf++D.m7"}HW6.#=U:?2GGctkL,f89@H46O$ASoW&?s}.k+&.<b';Md8`dH6iqhT)6C^.Px|[=M@7=Ik[_w<%n1Up"LPQNu2m8|L!/3iby{-]A+#YE}Kl{Cw$\U!kD%K}\2jz"QQP6Uqr],./"?;=4v
Face iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEXTxa4RFk5dUWANED8PFEfy7+MGBiW+n3ZNF/QuAAACaElEQVQ4jVXUwVOcMBQG8Dc7Rc4PUntdWV2uxjDpGaGeozOp1woar4jd5t/v9wLstMwsA/ntlxdCAgUc1hjTc9/JCZfGoo3wG3HdmdAWrIJRHe7GM/TmpY5VFefuVcAkkPbLIaN8rmPmjloyZxgyR3GuJ4K0AGtJ2htz8o7yqikm759fldQXaMpbDzjKAG+8v+AugVTOPO5DOjLvGtUYQwh0CPjnVMyGd+8/GfUB5nLKJDD2aLDh5HYyMDJGDwQIo2ZmZcKbowNmAdB/AzyFhrmF2MHRb0QJJfaAnwGB6orZhoykLzJtGwF/xpYxI1dswomiUj3gTuAIqCn/4C7cULwGNBtwMTk3Y4LfKB5YUaOKBKYtpplm7u0vip8tU1NWWyI/7XdcSuIDoMt6rVHMWT0DbjHPGqDqZVSa6zleLcUTcIKLoMv3ueJluALtAo9B302zPPlrtiVScRdCjXvVh3e3JpYa/jjkuC9N+LrBMlz/eAN4eQijX2EdLo6c5tGGHwLyHFtXk89dDGHwCVhG9T0S/j55AhRZgkMCmUQXJ49TnS1wnQDvw0eAh9ICeMmEFbCnPMFzjAvsWoEWEFdYEx+S0MoUZ1gT1wId8+AF3Bl2OoEu906AUHx5VLw/gXYg/x84loOah/2UYNrgiwSwGO7RfUzVBbx/kgpckumGOi6QirtD6gkLTitbnxNol47S2jVc2vsN5kPqaAHT8uUdAJM4v/DanjYOwmUjWznGfwB7sGtAtor5BgofDuzaRj4kSQAqDakTsKORa3Q3xKi3gE1fhl71KRMqrdZ2AWNNg/YOhQyrVBnb+i+nEg4bsDA+egAAAABJRU5ErkJggg==
Subject Re: $referrer = $_SERVER['HTTP_REFERER'] echo
Newsgroups comp.lang.php
References <kqiah2$5r6$1@speranza.aioe.org> <51ccb0f4$0$6583$9b4e6d93@newsspool3.arcor-online.net> <11636905.NVDnM4sIge@PointedEars.de> <51ccd5a6$0$6565$9b4e6d93@newsspool3.arcor-online.net> <8079633.1c0m0cjtWk@PointedEars.de> <51cdcfe6$0$6576$9b4e6d93@newsspool3.arcor-online.net>
MIME-Version 1.0
Lines 108
NNTP-Posting-Date 28 Jun 2013 21:50:00 CEST
NNTP-Posting-Host 7456c30b.newsspool3.arcor-online.net
X-Trace DXC=O]hGUNkAAN<d8Nb@@ZG@b=McF=Q^Z^V384Fo<]lROoR18kF<OcfhCO;Q^kYTE\6d>1DZm8W4\YJN<b@mF9jNikd57a5\<`>]gf>lllcJG7ROG2
X-Complaints-To usenet-abuse@arcor.de
Xref csiph.com comp.lang.php:9925

Show key headers only | View raw


Christoph Michael Becker wrote:

> Thomas 'PointedEars' Lahn wrote:
>> Christoph Michael Becker wrote:
>>> Thomas 'PointedEars' Lahn wrote:
>>> Anyway, it seems the regular expression given in Appendix B of RFC 2396
>>> *seems* to be more permissive than the actual syntax given in Appendix
>>> A. 
>> Appendixes are not normative.  Assuming relevance, in which way does it
>> seem more permissive?
> 
> The following example passes the regular expression in Appendix B of RFC
> 2396, but it is not allowed according to Appendix A (if I'm not mistaken):
> 
>   http://http://example.com

You are mistaken.  The relevant productions are:

  URI-reference = [ absoluteURI | relativeURI ] [ "#" fragment ]
  absoluteURI   = scheme ":" ( hier_part | opaque_part )
  scheme        = alpha *( alpha | digit | "+" | "-" | "." )
  hier_part     = ( net_path | abs_path ) [ "?" query ]
  abs_path      = "/"  path_segments
  path_segments = segment *( "/" segment )
  segment       = *pchar *( ";" param )
  pchar         = unreserved | escaped |
                  ":" | "@" | "&" | "=" | "+" | "$" | ","
  unreserved    = alphanum | mark
  mark          = "-" | "_" | "." | "!" | "~" | "*" | "'" |
                  "(" | ")"
  alphanum      = alpha | digit
  alpha         = lowalpha | upalpha
  lowalpha      = "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" |
                  "j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" |
                  "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z"

Applied:

     URI-reference
  => [ absoluteURI | relativeURI ] [ "#" fragment ]
  => absoluteURI
  => scheme ":" ( hier_part | opaque_part )
  => scheme ":" hier_part
  => scheme ":" ( net_path | abs_path ) [ "?" query ]
  => scheme ":" abs_path
  => scheme ":" "/" path_segments
  => scheme ":" "/" segment *( "/" segment )
  => scheme ":" "/" segment "/" segment "/" segment "/" segment
  => scheme ":" "/" *pchar *( ";" param ) "/" *pchar *( ";" param ) "/" 
*pchar *( ";" param ) "/" *pchar *( ";" param )
  => scheme ":" "/" *pchar "/" *pchar "/" *pchar "/" *pchar
  => scheme ":" "/" "" "/" pchar pchar pchar pchar pchar "/" "" "/" pchar 
pchar pchar pchar pchar pchar pchar pchar pchar pchar pchar
  => scheme ":" "/" "" "/" unreserved unreserved unreserved unreserved ":" 
"/" "" "/" unreserved unreserved unreserved unreserved unreserved unreserved 
unreserved unreserved unreserved unreserved unreserved
  => scheme ":" "/" "" "/" alphanum alphanum alphanum alphanum ":" "/" "" 
"/" alphanum alphanum alphanum alphanum alphanum alphanum alphanum mark 
alphanum alphanum alphanum
  => scheme ":" "/" "" "/" alpha alpha alpha alpha ":" "/" "" "/" alpha 
alpha alpha alpha alpha alpha alpha mark alpha alpha alpha
  => scheme ":" "/" "" "/" lowalpha lowalpha lowalpha lowalpha ":" "/" "" 
"/" lowalpha lowalpha lowalpha lowalpha lowalpha lowalpha lowalpha mark 
lowalpha lowalpha lowalpha
  => scheme ":" "/" "" "/" "h" "t" "t" "p" ":" "/" "" "/" "e" "x" "a" "m" 
"p" "l" "e" "." "c" "o" "m"
  => alpha *( alpha | digit | "+" | "-" | "." ) ":" "/" "" "/" "h" "t" "t" 
"p" ":" "/" "" "/" "e" "x" "a" "m" "p" "l" "e" "." "c" "o" "m"
  => alpha alpha alpha alpha ":" "/" "" "/" "h" "t" "t" "p" ":" "/" "" "/" 
"e" "x" "a" "m" "p" "l" "e" "." "c" "o" "m"
  => lowalpha lowalpha lowalpha lowalpha ":" "/" "" "/" "h" "t" "t" "p" ":" 
"/" "e" "x" "a" "m" "p" "l" "e" "." "c" "o" "m"
  => "h" "t" "t" "p" ":" "/" "" "/" "h" "t" "t" "p" ":" "/" "" "/" "e" "x" 
"a" "m" "p" "l" "e" "." "c" "o" "m"
  => "http://http:/example.com"

[Some day I'll write an automatic grammar resolver.  And I should let prove 
other people their unfounded statements instead of going to lengths 
disproving them.]
  
These productions were probably not intended.  But note that the section is 
titled “*Parsing* a URI Reference with a Regular Expression”, _not_ 
“*Validating* a URI Reference”, and that URI References also include things 
like “javascript:window.alert("42");”.
 
>>> I have not checked RFC 3986 regarding this issue yet.
>>>
>>>> But I would never check against the HTTP-Referer [sic!] in the first
>>>> place. There are much more reliable solutions, like session variables.
>>>> See also <https://owasp.org/>.
>>>
>>> ACK.  OTOH I have some concerns regarding cookies (I do not "like" to
>>> propagate session IDs as a GET parameter) due to the European cookie
>>> law(s).
>> 
>> Directive 95/46/EC does not apply here.
> 
> I was referring to directive 2009/136/EC, which *might* apply.

How?


PointedEars 
-- 
Use any version of Microsoft Frontpage to create your site.
(This won't prevent people from viewing your source, but no one
will want to steal it.)
  -- from <http://www.vortex-webdesign.com/help/hidesource.htm> (404-comp.)

Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

$referrer = $_SERVER['HTTP_REFERER'] echo Twayne <nobody@spamcop.net> - 2013-06-27 17:23 -0400
  RESOLVED Re: $referrer = $_SERVER['HTTP_REFERER'] echo Twayne <nobody@spamcop.net> - 2013-06-27 17:34 -0400
  Re: $referrer = $_SERVER['HTTP_REFERER'] echo Christoph Michael Becker <cmbecker69@arcor.de> - 2013-06-27 23:40 +0200
    Re: $referrer = $_SERVER['HTTP_REFERER'] echo Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-06-28 00:19 +0200
      Re: $referrer = $_SERVER['HTTP_REFERER'] echo Christoph Michael Becker <cmbecker69@arcor.de> - 2013-06-28 02:16 +0200
        Re: $referrer = $_SERVER['HTTP_REFERER'] echo Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-06-28 10:56 +0200
          Re: $referrer = $_SERVER['HTTP_REFERER'] echo Christoph Michael Becker <cmbecker69@arcor.de> - 2013-06-28 20:03 +0200
            Re: $referrer = $_SERVER['HTTP_REFERER'] echo Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-06-28 21:49 +0200
              Re: $referrer = $_SERVER['HTTP_REFERER'] echo Christoph Michael Becker <cmbecker69@arcor.de> - 2013-06-28 22:37 +0200
                Re: $referrer = $_SERVER['HTTP_REFERER'] echo Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-06-28 23:55 +0200
      Re: $referrer = $_SERVER['HTTP_REFERER'] echo Twayne <nobody@spamcop.net> - 2013-06-28 13:49 -0400
        Re: $referrer = $_SERVER['HTTP_REFERER'] echo Christoph Michael Becker <cmbecker69@arcor.de> - 2013-06-28 20:13 +0200
    Re: $referrer = $_SERVER['HTTP_REFERER'] echo Twayne <nobody@spamcop.net> - 2013-06-28 13:33 -0400
  Re: $referrer = $_SERVER['HTTP_REFERER'] echo Jerry Stuckle <jstucklex@attglobal.net> - 2013-06-27 17:52 -0400
    Re: $referrer = $_SERVER['HTTP_REFERER'] echo Twayne <nobody@spamcop.net> - 2013-06-28 14:07 -0400
      Re: $referrer = $_SERVER['HTTP_REFERER'] echo Jerry Stuckle <jstucklex@attglobal.net> - 2013-06-28 15:26 -0400
        Re: $referrer = $_SERVER['HTTP_REFERER'] echo Twayne <nobody@spamcop.net> - 2013-06-28 16:03 -0400
          Re: $referrer = $_SERVER['HTTP_REFERER'] echo Jerry Stuckle <jstucklex@attglobal.net> - 2013-06-28 16:07 -0400
            Re: $referrer = $_SERVER['HTTP_REFERER'] echo Christoph Michael Becker <cmbecker69@arcor.de> - 2013-06-28 22:46 +0200
              Re: $referrer = $_SERVER['HTTP_REFERER'] echo Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-06-28 23:58 +0200

csiph-web