Wordpress Social Discussions Plugin Remote File Include Vulnerability
26 Oct. 2012
Summary
The Social Discussions Plugin for WordPress is prone to a remote file-include vulnerability because it fails to sufficiently sanitize user-supplied input.
Vulnerable Systems:
* Wordpress Social Discussions 6.1.1
Exploiting this issue could allow an attacker to compromise the application and the underlying system; other attacks are also possible.
1. Remote File Inclusion in "social-discussions-networkpub_ajax.php"
Reasons: Uninitialized variable "$HTTP_ENV_VARS"
Attack vectors: User-supplied parameter "HTTP_ENV_VARS"
Preconditions:
1. register_globals=on
2. register_long_arrays=off
3. allow_url_include=on for RFI if PHP >= 5.2.0
4. PHP must be < 5.3.4 for LFI null-byte attacks
5. magic_quotes_gpc=off for LFI null-byte attacks
Php script "social-discussions-networkpub_ajax.php" line 2:
------------------------[ source code start ]----------------------------------
if (!function_exists('add_action')){
@include_once($GLOBALS['HTTP_ENV_VARS']['DOCUMENT_ROOT'] . "/wp-config.php");
------------------------[ source code end ]------------------------------------
We can see, that script expects old-style array "HTTP_ENV_VARS" to be initialized
and containing "DOCUMENT_ROOT" entry. But it appears, that if PHP directive
"register_long_arrays=off", then "HTTP_ENV_VARS" is uninitialized and if in
same time "register_globals=on", it is possible to fill that array with any
value, leading to the RFI (Remote File Inclusion) vulnerability.
Reasons: Direct request to php script triggers pathname leak in error message
Preconditions: PHP directive display_errors=on
Result: Information Exposure Through an Error Message