PHP CGI 漏洞 與 Facebook 解法 - 2012

PHP 最近被爆出跑 mod_cgi 會有漏洞, 可以看到 PHP code 的原始碼.

PHP CGI 漏洞新聞

詳見下述新聞

CGI 漏洞語法

  • http://localhost/index.php?-s

暫時於 Apache 使用的修補方式

  • RewriteCond %{QUERY_STRING} ^(%2d|-)[^=]+$ [NC]
  • RewriteRule ^(.*) $1? [L]

Facebook 對此漏洞的處理法

有此漏洞, 自然很多人會想在 Facebook 玩玩看, Facebook 也很爽快的讓大家看到 Source code.

連到 http://facebook.com/?-s, 會秀出下述的 Source code:

<?php

include_once 'https://www.facebook.com/careers/department?dept=engineering&req=a2KA0000000Lt8LMAS';

連到 Source code 寫的 Facebook 的連結頁面, 就可以看到 Security Engineer 的 Apply for this position 按鈕. 😛

相關網頁

作者: Tsung

對新奇的事物都很有興趣, 喜歡簡單的東西, 過簡單的生活.

在〈PHP CGI 漏洞 與 Facebook 解法 - 2012〉中有 6 則留言

  1. hello,are you Chinese from Taiwan? or Hongkong?
    I like your site.I am also an IT Geek from China.
    sorry for writting my message in English for I have no Traditional Chinese input.

  2. Hello Tsung :

    我也有碰到這個問題,已啟用’mod_rewrite’,但不知「暫時於 Apache 使用的修補方式」的那兩行要加在那邊?想向您求助!!感謝!

    Charles

Charles 發表迴響取消回覆

這個網站採用 Akismet 服務減少垃圾留言。進一步了解 Akismet 如何處理網站訪客的留言資料