{"id":55,"date":"2006-06-15T22:50:25","date_gmt":"2006-06-15T20:50:25","guid":{"rendered":"http:\/\/konstantin.filtschew.de\/blog\/?p=55"},"modified":"2006-06-15T22:50:25","modified_gmt":"2006-06-15T20:50:25","slug":"regular-expressions-stellen-unter-php-eine-sicherheitsgefahrung-dar","status":"publish","type":"post","link":"https:\/\/konstantin.filtschew.de\/blog\/2006\/06\/15\/regular-expressions-stellen-unter-php-eine-sicherheitsgefahrung-dar\/","title":{"rendered":"Regular Expressions stellen unter PHP eine Sicherheitsgef\u00e4hrung dar"},"content":{"rendered":"<p>Viele Entwickler benutzen Regular Expressions um Eingaben zu validieren oder Inhalte auf ihre Korrektheit zu pr\u00fcfen.<\/p>\n<p>Die von RedTeam Pentesting gefundene Sicherheitsl\u00fccke in der PHP-Funktion <a title=\"Eregi PHP-Funktion f\u00fcr Regul\u00e4re Ausdr\u00fccke\" href=\"http:\/\/de.php.net\/eregi\">eregi()<\/a> stellt eine besondere Gefahr dar. Die Funktion ist in der Programmiersprache C programmiert und erkennt das Null-Terminierungszeichen &#8222;\\0&#8220; als Ende des Strings. Laut RedTeam Pentesting werden alle Zeichen nach dem Null-Terminierungszeichen nicht mehr beachtet und damit nicht validiert.<\/p>\n<p>Das Beispiel in dem Heise-Newsticker verdeutlicht das Problem: <a title=\"Heise Newsticker Meldung: Ausnutzungsbeweis\" href=\"http:\/\/www.heise.de\/newsticker\/meldung\/74319\">Heise-Newsticker Meldung<\/a><\/p>\n<p>Das Verhalten der <a title=\"Eregi PHP-Funktion f\u00fcr Regul\u00e4re Ausdr\u00fccke\" href=\"http:\/\/de.php.net\/eregi\">eregi()<\/a> Funktion ist keine neue Erkenntnis, sondern schon lange bekannt. Der \u00e4lteste Bugtraq Eintrag zu dieser Funktion datiert auf das Jahr 2002. Die Antwort zu diesem Problem war ein simpler Eintrag: &#8222;Eregi ist nicht binary safe&#8220;. Das bedeutet man kann \u00dcberpr\u00fcfungen mit dieser Funktion ganz einfach umgehen indem man ein Null-Terminierungszeichen einf\u00fcgt und die weiteren Inhalte ohne Validierung \u00fcbergibt.<\/p>\n<p>Das gr\u00f6\u00dfere Problem ist, dass sich kaum ein Programmierer die vollst\u00e4ndige Dokumentation zu dieser Funktion durchliest und damit nicht wei\u00df, dass die Funktion gef\u00e4hrlich ist!<\/p>\n<p>Das Problem kann man mit <a title=\"PHP Magic Quotes f\u00fcr Sonderzeichen Behandlung\" href=\"http:\/\/de.php.net\/magic_quotes\">Magic Quotes<\/a> umgehen, die Sonderzeichen wie &#8218;, &#8222;, \\ und NULL in einer Zeichenkette automatisch einen Backslash(\\) voranstellt. Eine Saubere L\u00f6sung w\u00e4re aber der Einsatz der Perl-Syntax-kompatiblen preg_*-Funktion.<\/p>\n<p>Quellen und Informationen:<\/p>\n<ul>\n<li><a title=\"Heise Newsticker Meldung\" href=\"http:\/\/www.heise.de\/newsticker\/meldung\/74319\">Heise Newsticker Meldung<\/a><\/li>\n<\/ul>\n<ul>\n<li><a target=\"_blank\" href=\"http:\/\/www.redteam-pentesting.de\/advisories\/rt-sa-2006-005.php?lang=de\">Unauthorized password recovery in phpBannerExchange<\/a>, Sicherheitsmeldung vom RedTeam Pentesting<\/li>\n<\/ul>\n<ul>\n<li><a target=\"_blank\" href=\"http:\/\/www.redteam-pentesting.de\/advisories\/rt-sa-2006-004.php?lang=de\">Authentication bypass in phpBannerExchange<\/a>, Fehlermeldung vom RedTeam Pentesting<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Viele Entwickler benutzen Regular Expressions um Eingaben zu validieren oder Inhalte auf ihre Korrektheit zu pr\u00fcfen. Die von RedTeam Pentesting gefundene Sicherheitsl\u00fccke in der PHP-Funktion eregi() stellt eine besondere Gefahr dar. Die Funktion ist in der Programmiersprache C programmiert und erkennt das Null-Terminierungszeichen &#8222;\\0&#8220; als Ende des Strings. Laut RedTeam Pentesting werden alle Zeichen nach [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,9],"tags":[],"class_list":["post-55","post","type-post","status-publish","format-standard","hentry","category-opensourcesoftware","category-sicherheit"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Regular Expressions stellen unter PHP eine Sicherheitsgef\u00e4hrung dar - Konstantin Filtschew<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/konstantin.filtschew.de\/blog\/2006\/06\/15\/regular-expressions-stellen-unter-php-eine-sicherheitsgefahrung-dar\/\" \/>\n<meta property=\"og:locale\" content=\"de_DE\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Regular Expressions stellen unter PHP eine Sicherheitsgef\u00e4hrung dar - Konstantin Filtschew\" \/>\n<meta property=\"og:description\" content=\"Viele Entwickler benutzen Regular Expressions um Eingaben zu validieren oder Inhalte auf ihre Korrektheit zu pr\u00fcfen. Die von RedTeam Pentesting gefundene Sicherheitsl\u00fccke in der PHP-Funktion eregi() stellt eine besondere Gefahr dar. Die Funktion ist in der Programmiersprache C programmiert und erkennt das Null-Terminierungszeichen &#8222;&#8220; als Ende des Strings. Laut RedTeam Pentesting werden alle Zeichen nach [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/konstantin.filtschew.de\/blog\/2006\/06\/15\/regular-expressions-stellen-unter-php-eine-sicherheitsgefahrung-dar\/\" \/>\n<meta property=\"og:site_name\" content=\"Konstantin Filtschew\" \/>\n<meta property=\"article:published_time\" content=\"2006-06-15T20:50:25+00:00\" \/>\n<meta name=\"author\" content=\"Konstantin Filtschew\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@fa11enangel\" \/>\n<meta name=\"twitter:site\" content=\"@fa11enangel\" \/>\n<meta name=\"twitter:label1\" content=\"Verfasst von\" \/>\n\t<meta name=\"twitter:data1\" content=\"Konstantin Filtschew\" \/>\n\t<meta name=\"twitter:label2\" content=\"Gesch\u00e4tzte Lesezeit\" \/>\n\t<meta name=\"twitter:data2\" content=\"1\u00a0Minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/konstantin.filtschew.de\/blog\/2006\/06\/15\/regular-expressions-stellen-unter-php-eine-sicherheitsgefahrung-dar\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/konstantin.filtschew.de\/blog\/2006\/06\/15\/regular-expressions-stellen-unter-php-eine-sicherheitsgefahrung-dar\/\"},\"author\":{\"name\":\"Konstantin Filtschew\",\"@id\":\"https:\/\/konstantin.filtschew.de\/blog\/#\/schema\/person\/de09aadf27dd3b71cb0030f6f2214b1e\"},\"headline\":\"Regular Expressions stellen unter PHP eine Sicherheitsgef\u00e4hrung dar\",\"datePublished\":\"2006-06-15T20:50:25+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/konstantin.filtschew.de\/blog\/2006\/06\/15\/regular-expressions-stellen-unter-php-eine-sicherheitsgefahrung-dar\/\"},\"wordCount\":231,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/konstantin.filtschew.de\/blog\/#\/schema\/person\/de09aadf27dd3b71cb0030f6f2214b1e\"},\"articleSection\":[\"OpenSource Software\",\"Sicherheit\"],\"inLanguage\":\"de\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/konstantin.filtschew.de\/blog\/2006\/06\/15\/regular-expressions-stellen-unter-php-eine-sicherheitsgefahrung-dar\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/konstantin.filtschew.de\/blog\/2006\/06\/15\/regular-expressions-stellen-unter-php-eine-sicherheitsgefahrung-dar\/\",\"url\":\"https:\/\/konstantin.filtschew.de\/blog\/2006\/06\/15\/regular-expressions-stellen-unter-php-eine-sicherheitsgefahrung-dar\/\",\"name\":\"Regular Expressions stellen unter PHP eine Sicherheitsgef\u00e4hrung dar - Konstantin Filtschew\",\"isPartOf\":{\"@id\":\"https:\/\/konstantin.filtschew.de\/blog\/#website\"},\"datePublished\":\"2006-06-15T20:50:25+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/konstantin.filtschew.de\/blog\/2006\/06\/15\/regular-expressions-stellen-unter-php-eine-sicherheitsgefahrung-dar\/#breadcrumb\"},\"inLanguage\":\"de\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/konstantin.filtschew.de\/blog\/2006\/06\/15\/regular-expressions-stellen-unter-php-eine-sicherheitsgefahrung-dar\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/konstantin.filtschew.de\/blog\/2006\/06\/15\/regular-expressions-stellen-unter-php-eine-sicherheitsgefahrung-dar\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Startseite\",\"item\":\"https:\/\/konstantin.filtschew.de\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Regular Expressions stellen unter PHP eine Sicherheitsgef\u00e4hrung dar\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/konstantin.filtschew.de\/blog\/#website\",\"url\":\"https:\/\/konstantin.filtschew.de\/blog\/\",\"name\":\"Konstantin Filtschew\",\"description\":\"Der t\u00e4gliche IT-Wahnsinn\",\"publisher\":{\"@id\":\"https:\/\/konstantin.filtschew.de\/blog\/#\/schema\/person\/de09aadf27dd3b71cb0030f6f2214b1e\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/konstantin.filtschew.de\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"de\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/konstantin.filtschew.de\/blog\/#\/schema\/person\/de09aadf27dd3b71cb0030f6f2214b1e\",\"name\":\"Konstantin Filtschew\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"de\",\"@id\":\"https:\/\/konstantin.filtschew.de\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/konstantin.filtschew.de\/blog\/wp-content\/uploads\/2025\/10\/KFLogo1.png\",\"contentUrl\":\"https:\/\/konstantin.filtschew.de\/blog\/wp-content\/uploads\/2025\/10\/KFLogo1.png\",\"width\":222,\"height\":193,\"caption\":\"Konstantin Filtschew\"},\"logo\":{\"@id\":\"https:\/\/konstantin.filtschew.de\/blog\/#\/schema\/person\/image\/\"},\"description\":\"Building an operation system without source code, is like buying a self assemble space shuttle without instructions. (Author unknown)\",\"sameAs\":[\"https:\/\/konstantin.filtschew.de\",\"https:\/\/www.linkedin.com\/in\/konstantin-filtschew-b7138019\/\",\"https:\/\/x.com\/fa11enangel\"],\"url\":\"https:\/\/konstantin.filtschew.de\/blog\/author\/konstantin-filtschew\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Regular Expressions stellen unter PHP eine Sicherheitsgef\u00e4hrung dar - Konstantin Filtschew","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/konstantin.filtschew.de\/blog\/2006\/06\/15\/regular-expressions-stellen-unter-php-eine-sicherheitsgefahrung-dar\/","og_locale":"de_DE","og_type":"article","og_title":"Regular Expressions stellen unter PHP eine Sicherheitsgef\u00e4hrung dar - Konstantin Filtschew","og_description":"Viele Entwickler benutzen Regular Expressions um Eingaben zu validieren oder Inhalte auf ihre Korrektheit zu pr\u00fcfen. Die von RedTeam Pentesting gefundene Sicherheitsl\u00fccke in der PHP-Funktion eregi() stellt eine besondere Gefahr dar. Die Funktion ist in der Programmiersprache C programmiert und erkennt das Null-Terminierungszeichen &#8222;&#8220; als Ende des Strings. Laut RedTeam Pentesting werden alle Zeichen nach [&hellip;]","og_url":"https:\/\/konstantin.filtschew.de\/blog\/2006\/06\/15\/regular-expressions-stellen-unter-php-eine-sicherheitsgefahrung-dar\/","og_site_name":"Konstantin Filtschew","article_published_time":"2006-06-15T20:50:25+00:00","author":"Konstantin Filtschew","twitter_card":"summary_large_image","twitter_creator":"@fa11enangel","twitter_site":"@fa11enangel","twitter_misc":{"Verfasst von":"Konstantin Filtschew","Gesch\u00e4tzte Lesezeit":"1\u00a0Minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/konstantin.filtschew.de\/blog\/2006\/06\/15\/regular-expressions-stellen-unter-php-eine-sicherheitsgefahrung-dar\/#article","isPartOf":{"@id":"https:\/\/konstantin.filtschew.de\/blog\/2006\/06\/15\/regular-expressions-stellen-unter-php-eine-sicherheitsgefahrung-dar\/"},"author":{"name":"Konstantin Filtschew","@id":"https:\/\/konstantin.filtschew.de\/blog\/#\/schema\/person\/de09aadf27dd3b71cb0030f6f2214b1e"},"headline":"Regular Expressions stellen unter PHP eine Sicherheitsgef\u00e4hrung dar","datePublished":"2006-06-15T20:50:25+00:00","mainEntityOfPage":{"@id":"https:\/\/konstantin.filtschew.de\/blog\/2006\/06\/15\/regular-expressions-stellen-unter-php-eine-sicherheitsgefahrung-dar\/"},"wordCount":231,"commentCount":0,"publisher":{"@id":"https:\/\/konstantin.filtschew.de\/blog\/#\/schema\/person\/de09aadf27dd3b71cb0030f6f2214b1e"},"articleSection":["OpenSource Software","Sicherheit"],"inLanguage":"de","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/konstantin.filtschew.de\/blog\/2006\/06\/15\/regular-expressions-stellen-unter-php-eine-sicherheitsgefahrung-dar\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/konstantin.filtschew.de\/blog\/2006\/06\/15\/regular-expressions-stellen-unter-php-eine-sicherheitsgefahrung-dar\/","url":"https:\/\/konstantin.filtschew.de\/blog\/2006\/06\/15\/regular-expressions-stellen-unter-php-eine-sicherheitsgefahrung-dar\/","name":"Regular Expressions stellen unter PHP eine Sicherheitsgef\u00e4hrung dar - Konstantin Filtschew","isPartOf":{"@id":"https:\/\/konstantin.filtschew.de\/blog\/#website"},"datePublished":"2006-06-15T20:50:25+00:00","breadcrumb":{"@id":"https:\/\/konstantin.filtschew.de\/blog\/2006\/06\/15\/regular-expressions-stellen-unter-php-eine-sicherheitsgefahrung-dar\/#breadcrumb"},"inLanguage":"de","potentialAction":[{"@type":"ReadAction","target":["https:\/\/konstantin.filtschew.de\/blog\/2006\/06\/15\/regular-expressions-stellen-unter-php-eine-sicherheitsgefahrung-dar\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/konstantin.filtschew.de\/blog\/2006\/06\/15\/regular-expressions-stellen-unter-php-eine-sicherheitsgefahrung-dar\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Startseite","item":"https:\/\/konstantin.filtschew.de\/blog\/"},{"@type":"ListItem","position":2,"name":"Regular Expressions stellen unter PHP eine Sicherheitsgef\u00e4hrung dar"}]},{"@type":"WebSite","@id":"https:\/\/konstantin.filtschew.de\/blog\/#website","url":"https:\/\/konstantin.filtschew.de\/blog\/","name":"Konstantin Filtschew","description":"Der t\u00e4gliche IT-Wahnsinn","publisher":{"@id":"https:\/\/konstantin.filtschew.de\/blog\/#\/schema\/person\/de09aadf27dd3b71cb0030f6f2214b1e"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/konstantin.filtschew.de\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"de"},{"@type":["Person","Organization"],"@id":"https:\/\/konstantin.filtschew.de\/blog\/#\/schema\/person\/de09aadf27dd3b71cb0030f6f2214b1e","name":"Konstantin Filtschew","image":{"@type":"ImageObject","inLanguage":"de","@id":"https:\/\/konstantin.filtschew.de\/blog\/#\/schema\/person\/image\/","url":"https:\/\/konstantin.filtschew.de\/blog\/wp-content\/uploads\/2025\/10\/KFLogo1.png","contentUrl":"https:\/\/konstantin.filtschew.de\/blog\/wp-content\/uploads\/2025\/10\/KFLogo1.png","width":222,"height":193,"caption":"Konstantin Filtschew"},"logo":{"@id":"https:\/\/konstantin.filtschew.de\/blog\/#\/schema\/person\/image\/"},"description":"Building an operation system without source code, is like buying a self assemble space shuttle without instructions. (Author unknown)","sameAs":["https:\/\/konstantin.filtschew.de","https:\/\/www.linkedin.com\/in\/konstantin-filtschew-b7138019\/","https:\/\/x.com\/fa11enangel"],"url":"https:\/\/konstantin.filtschew.de\/blog\/author\/konstantin-filtschew\/"}]}},"_links":{"self":[{"href":"https:\/\/konstantin.filtschew.de\/blog\/wp-json\/wp\/v2\/posts\/55","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/konstantin.filtschew.de\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/konstantin.filtschew.de\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/konstantin.filtschew.de\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/konstantin.filtschew.de\/blog\/wp-json\/wp\/v2\/comments?post=55"}],"version-history":[{"count":0,"href":"https:\/\/konstantin.filtschew.de\/blog\/wp-json\/wp\/v2\/posts\/55\/revisions"}],"wp:attachment":[{"href":"https:\/\/konstantin.filtschew.de\/blog\/wp-json\/wp\/v2\/media?parent=55"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/konstantin.filtschew.de\/blog\/wp-json\/wp\/v2\/categories?post=55"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/konstantin.filtschew.de\/blog\/wp-json\/wp\/v2\/tags?post=55"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}