<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>teracc</author_name>
  <author_url>https://blog.hatena.ne.jp/teracc/</author_url>
  <blog_title>teracc’s blog</blog_title>
  <blog_url>https://blog.ts5.me/</blog_url>
  <categories>
    <anon>セキュリティ</anon>
    <anon>PHP</anon>
  </categories>
  <description>最近少し調べていたのが、PHPの任意コード実行系の脆弱性です。中でも、preg_replace関数（Perl互換の正規表現による置換を行なうための関数）を不適切な方法で使った場合に発生する脆弱性について調べていました。せっかくなので、日記にまとめてみます。 3種類の脆弱性 preg_replace関数を使ったPHPコード実行系の脆弱性には、大きく分けて3つの種類があります。 第一引数への挿入を許す e修飾子付き・第二引数への挿入を許す e修飾子付き・第三引数への挿入を許す 以下でそれぞれについて見ていきます。 タイプ１：第一引数への挿入 以下のコードに、任意のPHPコードが実行可能な脆弱性があ…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.ts5.me%2Fentry%2F20080606%2F1212764548&quot; title=&quot;preg_replaceによるコード実行 - teracc’s blog&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2008-06-06 00:02:28</published>
  <title>preg_replaceによるコード実行</title>
  <type>rich</type>
  <url>https://blog.ts5.me/entry/20080606/1212764548</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
