[KIS-2021-05] Concrete5 <= 8.5.5 (Logging Settings) Phar Deserialization Vulnerability

Related Vulnerabilities: CVE-2021-36766  
                							

                <!--X-Body-Begin-->
<!--X-User-Header-->
<a href="/fulldisclosure/"><img src="/images/fulldisclosure-logo.png" class="l-logo right" alt="fulldisclosure logo" width="80"></a>
<h2 class="m-list"><a href="/fulldisclosure/">Full Disclosure</a>
mailing list archives</h2>
<!--X-User-Header-End-->
<!--X-TopPNI-->
<div class="nav-bar">
<div class="nav-link">
<a href="35"><img src="/images/left-icon-16x16.png" alt="Previous" width="16" height="16"></a>
<a href="date.html#36">By Date</a>
<a href="37"><img src="/images/right-icon-16x16.png" alt="Next" width="16" height="16"></a>
</div>
<div class="nav-link">
<a href="35"><img src="/images/left-icon-16x16.png" alt="Previous" width="16" height="16"></a>
<a href="index.html#36">By Thread</a>
<a href="37"><img src="/images/right-icon-16x16.png" alt="Next" width="16" height="16"></a>
</div>
<form class="nst-search center" action="/search/fulldisclosure">
<input class="nst-search-q" name="q" type="search" placeholder="List Archive Search">
<button class="nst-search-button" title="Search">
<img style="width:100%;aspect-ratio:1/1;" alt="" aria-hidden="true" src="/shared/images/nst-icons.svg#search">
</button>
</form>

</div>

<!--X-TopPNI-End-->
<!--X-MsgBody-->
<!--X-Subject-Header-Begin-->
<h1 class="m-title">[KIS-2021-05] Concrete5 &lt;= 8.5.5 (Logging Settings) Phar Deserialization Vulnerability</h1>
<hr>
<!--X-Subject-Header-End-->
<!--X-Head-of-Message-->


<em>From</em>: Egidio Romano &lt;research () karmainsecurity com&gt;


<em>Date</em>: Mon, 19 Jul 2021 20:49:35 +0200


<!--X-Head-of-Message-End-->
<!--X-Head-Body-Sep-Begin-->
<hr>
<!--X-Head-Body-Sep-End-->
<!--X-Body-of-Message-->
<pre style="margin: 0em;">------------------------------------------------------------------------
Concrete5 &lt;= 8.5.5 (Logging Settings) Phar Deserialization Vulnerability
------------------------------------------------------------------------


[-] Software Link:

<a rel="nofollow" href="https://www.concrete5.org">https://www.concrete5.org</a>


[-] Affected Versions:

Version 8.5.5 and prior versions.


[-] Vulnerability Description:

</pre><tt>The vulnerable code is located within the 
</tt><tt>/concrete/controllers/single_page/dashboard/system/environment/logging.php 
</tt><tt>script. Specifically, into the Logging::update_logging()  method:
</tt><pre style="margin: 0em;">
61.         public function update_logging()
62.         {
63.             $config = $this-&gt;app-&gt;make('config');
64.             $request = $this-&gt;request;
65.
66.             if (!$this-&gt;token-&gt;validate('update_logging')) {
</pre><tt>67.	            return 
</tt><tt>$this-&gt;showError($this-&gt;token-&gt;getErrorMessage());
</tt><pre style="margin: 0em;">68.             }
69.
70.             // Load in variables from the request
</pre><tt>71.	        $mode = (string) $request-&gt;request-&gt;get('logging_mode') === 
</tt><tt>'advanced' ? 'advanced' : 'simple';
</tt><tt>72.	        $handler = $mode === 'simple' ? (string) 
</tt><tt>$request-&gt;request-&gt;get('handler', 'database') : null;
</tt><tt>73.	        $logFile = $handler === 'file' ? (string) 
</tt><tt>$request-&gt;request-&gt;get('logFile') : null;
</tt><tt>74.	        $enableDashboardReport = 
</tt><tt>$request-&gt;request-&gt;get('enable_dashboard_report') ? true : false;
</tt><tt>75.	        $loggingLevel = strtoupper((string) 
</tt><tt>$request-&gt;request-&gt;get('logging_level'));
</tt><tt>76.	        $intLogErrorsPost = 
</tt><tt>$request-&gt;request-&gt;get('ENABLE_LOG_ERRORS') === 1 ? 1 : 0;
</tt><tt>77.	        $intLogEmailsPost = 
</tt><tt>$request-&gt;request-&gt;get('ENABLE_LOG_EMAILS') === 1 ? 1 : 0;
</tt><tt>78.	        $intLogApiPost = $request-&gt;request-&gt;get('ENABLE_LOG_API') 
</tt><tt>=== 1 ? 1 : 0;
</tt><pre style="margin: 0em;">79.
80.
81.             // Handle 'file' based logging
82.             if ($handler === 'file') {
83.                 $directory = dirname($logFile);
84.
85.                 // Validate the file name
86.                 if (pathinfo($logFile, PATHINFO_EXTENSION) !== 'log') {
</pre><tt>87.	                return $this-&gt;showError(t('The filename provided 
</tt><tt>must be a valid filename and end with .log'));
</tt><pre style="margin: 0em;">88.                 }
89.
90.                 // Validate the file path, create the log file if needed
91.                 if (!file_exists($logFile)) {


</pre><tt>User input passed through the "logFile" request parameter is not 
</tt><tt>properly sanitized before being used in a call to the file_exists() 
</tt><tt>function at line 91. This can be exploited by malicious users to inject 
</tt><tt>arbitrary PHP objects into the application scope (PHP Object Injection 
</tt><tt>via phar:// stream wrapper), allowing them to carry out a variety of 
</tt><tt>attacks, such as executing arbitrary PHP code. Successful exploitation 
</tt><tt>of this vulnerability requires an administrator account.
</tt><pre style="margin: 0em;">

[-] Solution:

No official solution is currently available.


[-] Disclosure Timeline:

[20/12/2020] - Vendor notified through HackerOne
</pre><tt>[22/12/2020] - Vendor asks suggestions to fix the issue, feedback 
</tt><tt>provided
</tt><pre style="margin: 0em;">[18/03/2021] - Version 8.5.5 released, vulnerability not fixed
[02/06/2021] - Asked for an update, no response
[06/07/2021] - Asked for an update, no response
[16/07/2021] - CVE number assigned
[19/07/2021] - Public disclosure


[-] CVE Reference:

The Common Vulnerabilities and Exposures project (cve.mitre.org)
has assigned the name CVE-2021-36766 to this vulnerability.


[-] Credits:

Vulnerability discovered by Egidio Romano.


[-] Other References:

<a rel="nofollow" href="https://hackerone.com/reports/1063039">https://hackerone.com/reports/1063039</a>


[-] Original Advisory:

<a rel="nofollow" href="http://karmainsecurity.com/KIS-2021-05">http://karmainsecurity.com/KIS-2021-05</a>


_______________________________________________
Sent through the Full Disclosure mailing list
<a rel="nofollow" href="https://nmap.org/mailman/listinfo/fulldisclosure">https://nmap.org/mailman/listinfo/fulldisclosure</a>
Web Archives &amp; RSS: <a rel="nofollow" href="http://seclists.org/fulldisclosure/">http://seclists.org/fulldisclosure/</a>

</pre>
<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<hr>
<!--X-Follow-Ups-End-->
<!--X-References-->
<!--X-References-End-->
<!--X-BotPNI-->
<div class="nav-bar">
<div class="nav-link">
<a href="35"><img src="/images/left-icon-16x16.png" alt="Previous" width="16" height="16"></a>
<a href="date.html#36">By Date</a>
<a href="37"><img src="/images/right-icon-16x16.png" alt="Next" width="16" height="16"></a>
</div>
<div class="nav-link">
<a href="35"><img src="/images/left-icon-16x16.png" alt="Previous" width="16" height="16"></a>
<a href="index.html#36">By Thread</a>
<a href="37"><img src="/images/right-icon-16x16.png" alt="Next" width="16" height="16"></a>
</div>
</div>
<h3 class="m-thread">Current thread:</h3>
<ul class="thread">
<li><strong>[KIS-2021-05] Concrete5 &lt;= 8.5.5 (Logging Settings) Phar Deserialization Vulnerability</strong> <em>Egidio Romano (Jul 19)</em>
</li></ul>


<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
<p>