Sagemcom router insecure deserialization > privilege escalation

Related Vulnerabilities: CVE-2020-24034  
                							

                <!--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="2"><img src="/images/left-icon-16x16.png" alt="Previous" width="16" height="16"></a>
<a href="date.html#3">By Date</a>
<a href="4"><img src="/images/right-icon-16x16.png" alt="Next" width="16" height="16"></a>
</div>
<div class="nav-link">
<a href="2"><img src="/images/left-icon-16x16.png" alt="Previous" width="16" height="16"></a>
<a href="index.html#3">By Thread</a>
<a href="4"><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">Sagemcom router insecure deserialization &gt; privilege escalation</h1>
<hr>
<!--X-Subject-Header-End-->
<!--X-Head-of-Message-->


<em>From</em>: Ryan Delaney &lt;ryan.delaney () owasp org&gt;


<em>Date</em>: Mon, 31 Aug 2020 14:58:44 -0500


<!--X-Head-of-Message-End-->
<!--X-Head-Body-Sep-Begin-->
<hr>
<!--X-Head-Body-Sep-End-->
<!--X-Body-of-Message-->
<pre style="margin: 0em;">&lt;!--
# Exploit Title: Sagemcom router insecure deserialization &gt; privilege
escalation
# Date: 08-31-2020
# Exploit Author: Ryan Delaney
# Author Contact: ryan.delaney () owasp org
# Author LinkedIn: <a rel="nofollow" href="https://www.linkedin.com/in/infosecrd/">https://www.linkedin.com/in/infosecrd/</a>
# Vendor Homepage: <a rel="nofollow" href="https://sagemcom.com/en">https://sagemcom.com/en</a>
# Software Link: N/A (F@ST 5280 firmware not published)
# Version: F@ST 5280 router, F/W 1.150.61, possibly others
# Tested on: F@ST 5280 router, F/W 1.150.61
# CVE: CVE-2020-24034

1. Description

Sagemcom F@ST 5280 routers using firmware version 1.150.61,
and possibly others, have an insecure deserialization vulnerability
that allows any authenticated user to perform a privilege escalation
to any other user. By making a request with valid sess_id, nonce,
and ha1 values inside of the serialized session cookie, an attacker may
alter the user value inside of this cookie, and assume the role and
permissions of the user specified. By assuming the role of the user
'internal', which is inaccessible to end users by default, the attacker
gains the permissions of the 'internal' account, which includes the
ability to flash custom firmware to the router, allowing the attacker
to achieve a complete compromise.

Note that the 'internal' account is disabled and hidden by default, and the
primary administrative account ('admin'), lacks the permission to
flash custom firmware to the device, meaning that an attacker
exploiting this vulnerability obtains access exceeding that of
the legitimate, authorized system administrator.

2. Proof of Concept

Log in as a valid user (default is admin:admin). Retrieve the 'session'
cookie. Simply change the only occurrence of the string "admin" within
the cookie to "internal", and make a new request with this modified cookie.
If you decode the cookie, you will note this is the 4th key value pair
inside of the cookie, where the key is "user", and the value is "admin".

3. Solution

This vulnerability is only exploitable with a valid existing session.
Changing the administrative password to a strong, non-default value,
and ensuring that TLS certificate has the correct fingerprint will
help prevent attackers from obtaining a valid existing session.

--&gt;

_______________________________________________
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="2"><img src="/images/left-icon-16x16.png" alt="Previous" width="16" height="16"></a>
<a href="date.html#3">By Date</a>
<a href="4"><img src="/images/right-icon-16x16.png" alt="Next" width="16" height="16"></a>
</div>
<div class="nav-link">
<a href="2"><img src="/images/left-icon-16x16.png" alt="Previous" width="16" height="16"></a>
<a href="index.html#3">By Thread</a>
<a href="4"><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>Sagemcom router insecure deserialization &gt; privilege escalation</strong> <em>Ryan Delaney (Sep 01)</em>
</li></ul>


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