<?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>piouPiouM&#039;s dev&#187; Archives pour le tag sécurité – piouPiouM&#039;s dev</title>
	<atom:link href="http://pioupioum.fr/tag/securite/feed/" rel="self" type="application/rss+xml" />
	<link>http://pioupioum.fr</link>
	<description>Bloc-note d&#039;un développeur web</description>
	<lastBuildDate>Fri, 23 Dec 2011 23:41:36 +0000</lastBuildDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Correctif pour la faille WordPress de réinitialisation de mot de passe</title>
		<link>http://pioupioum.fr/outils-astuces/faille-wordpress-mot-passe-correctif.html</link>
		<comments>http://pioupioum.fr/outils-astuces/faille-wordpress-mot-passe-correctif.html#comments</comments>
		<pubDate>Tue, 11 Aug 2009 12:41:37 +0000</pubDate>
		<dc:creator>piouPiouM</dc:creator>
				<category><![CDATA[Outils, trucs et astuces]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[patch]]></category>
		<category><![CDATA[sécurité]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://pioupioum.fr/?p=194</guid>
		<description><![CDATA[Une faille a été récemment découverte dans WordPress. Elle permet à quiconque de forcer la réinitialisation de mot de passe du compte admin (compte par défaut de WordPress).

Diverses &#8220;solutions&#8221; ont été apportées notamment par Korben ou encore par l&#8217;équipe de développement de l&#8217;outil de blogging.

Cependant ces correctifs sont crades&#160;: ils nous obligent à directement modifier [...]]]></description>
			<content:encoded><![CDATA[<!-- google_ad_section_start --><p>Une faille a été récemment découverte dans WordPress. Elle permet à quiconque de forcer la réinitialisation de mot de passe du compte admin (compte par défaut de WordPress).</p>

<p>Diverses &#8220;solutions&#8221; ont été apportées notamment par <a href="http://www.korben.info/se-proteger-du-hack-wordpress-2-8-3-qui-reinitialise-le-mot-de-passe.html" title="Se protéger du hack wordpress 2.8.3 qui réinitialise le mot de passe">Korben</a> ou encore par l&#8217;<a href="http://www.geekeries.fr/articles/faille-wordpress-reinitialisation-du-mot-de-passe/" title="Faille WordPress : Réinitialisation du mot de passe | Geekeries.fr - Astuces Wordpress 2.8, Plugins Wordpress 2.8, Blogging, Référencement, Actualités High Tech">équipe de développement</a> de l&#8217;outil de blogging.</p>

<p>Cependant ces correctifs sont <em>crades</em>&#160;: ils nous obligent à directement modifier le fichier <code>wp-login.php</code> de WordPress. Vous allez me dire que cela n&#8217;est pas gravisime compte tenu du fait qu&#8217;une mise à jour de WordPress sortira sous peu. Certes. Mais je déteste agir directement sur les sources de l&#8217;outil si ce dernier m&#8217;offre des points d&#8217;entrées pour arriver à mes fins depuis l&#8217;extérieur.</p>

<p>Ainsi, il vous suffit d&#8217;ajouter ce morceau de code dans le fichier <code>functions.php</code> de votre thème pour fixer le trou de sécurité.</p>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> fixes_reset_password_security<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$wp_version</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">version_compare</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$wp_version</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'2.8.3'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'&lt;='</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span>
        <span style="color: #009900; font-weight: bold;">false</span> <span style="color: #339933;">!==</span> <span style="color: #990000;">strpos</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">basename</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'SCRIPT_FILENAME'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'wp-login.php'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span>
        <span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'key'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #990000;">is_array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'key'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> 
    <span style="color: #009900;">&#123;</span>
        <span style="color: #990000;">unset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'key'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'init'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'fixes_reset_password_security'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>


<h3 class='related_post_title'>Continuez votre lecture sur des sujets similaires</h3>

<ul class='related_post'><li><a href='http://pioupioum.fr/outils-astuces/wordpress-smartypants-shortcode-caption.html' title='WordPress et SmartyPants : des légendes qui disparaissent'>WordPress et SmartyPants&#160;: des légendes qui disparaissent</a></li><li><a href='http://pioupioum.fr/developpement/shortcode-wordpress-integrer-flux-rss.html' title='Shortcode WordPress : intégrer un flux RSS'>Shortcode WordPress&#160;: intégrer un flux RSS</a></li><li><a href='http://pioupioum.fr/outils-astuces/wordpress-shortcode-afficher-fichiers-joints.html' title='Shortcode WordPress : afficher les documents liés aux billets'>Shortcode WordPress&#160;: afficher les documents liés aux billets</a></li><li><a href='http://pioupioum.fr/snippets/wordpress-create-shortcode-class.html' title='WordPress : une classe abstraite pour aider la création de shortcodes'>WordPress&#160;: une classe abstraite pour aider la création de shortcodes</a></li><li><a href='http://pioupioum.fr/snippets/wordpress-forcer-chargement-jquery-footer.html' title='WordPress : forcer le chargement de jQuery en bas de page'>WordPress&#160;: forcer le chargement de jQuery en bas de page</a></li></ul>
<!-- google_ad_section_end -->]]></content:encoded>
			<wfw:commentRss>http://pioupioum.fr/outils-astuces/faille-wordpress-mot-passe-correctif.html/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>

