<?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>HattaraTecLog</title>
	<atom:link href="http://teclog.hattara.info/?feed=rss2&#038;tag=13" rel="self" type="application/rss+xml" />
	<link>http://teclog.hattara.info</link>
	<description>LinuxネタとかPHPネタとかの技術ログ</description>
	<lastBuildDate>Tue, 18 Nov 2014 12:15:20 +0000</lastBuildDate>
	<language>ja</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.8</generator>
	<item>
		<title>register_globalsについて</title>
		<link>http://teclog.hattara.info/?p=19</link>
		<comments>http://teclog.hattara.info/?p=19#comments</comments>
		<pubDate>Wed, 17 Sep 2008 10:40:20 +0000</pubDate>
		<dc:creator><![CDATA[hattara]]></dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[]]></category>

		<guid isPermaLink="false">http://teclog.hattara.info/?p=19</guid>
		<description><![CDATA[前々からregister_globalsはoffにすべきというのは 知っていたのですが、プログラマーになって  [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>前々からregister_globalsはoffにすべきというのは<br />
知っていたのですが、プログラマーになって<br />
具体的にというか本気で困ることに気がついた。</p>
<p>そもそもregister_globalsがonだと、何ができるのかというと、</p>
<blockquote><p>http://a.com/?mode=bbb</p></blockquote>
<p>にアクセスした場合、簡単に書くと、</p>
<blockquote><p>
if ( $_GET["mode"] == &#8220;bbb&#8221; ){<br />
    echo &#8220;test&#8221;;<br />
}
</p></blockquote>
<p>みたいな感じでGETの値を使う訳ですが、<br />
register_globalsがonだと</p>
<blockquote><p>
if ( $mode == &#8220;bbb&#8221; ){<br />
    echo &#8220;test&#8221;;<br />
}
</p></blockquote>
<p>でも同じように通ってしまうわけですね。<br />
$_GETとか$_POSTのような特殊変数じゃなくても<br />
値が入ってしまうわけです。</p>
<p>これってミスの元になるし、脆弱性にもなりえますね。<br />
自分の意思で変更できる環境なら、やっぱり変更するべしですね。</p>
<p> ## でも、事前検証は確実・十分に!</p>
]]></content:encoded>
			<wfw:commentRss>http://teclog.hattara.info/?feed=rss2&#038;p=19</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
