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

Advantech WebAccess/SCADA 8.4.1 Unauthenticated Remote Stack Buffer Overflow

Critical

Synopsis

Tenable discovered an unauthenticated, remote stack overflow vulnerability in WebAccess/SCADA version 8.4.1.

CVE-2019-3975: Unauthenticated Remote Stack Buffer Overflow

The flaw exists in the GetUserPasswd function in BwPAlarm.dll due to improper validation of user-supplied data before copying the data to a fixed size stack-based buffer when processing an IOCTL 70603 RPC message.

The following snippet shows the vulnerability:

.text:0700700A      mov     esi, [ebp+arg_pInbuf]      ; jumptable 07006EDB case 10603
.text:0700700D      xor     eax, eax
.text:0700700F      mov     [ebp+var_20], eax
.text:07007012      mov     [ebp+var_18], eax
.text:07007015      lea     ecx, [ebp+var_DecodedLen]
.text:07007018      lea     eax, [ebp+b64Decoded]
.text:0700701E      lea     edx, [esi+10h]
.text:07007021      push    ecx                        ; int *
.text:07007022      push    eax                        ; unsigned __int8 *
.text:07007023      mov     edi, edx
.text:07007025      or      ecx, 0FFFFFFFFh
.text:07007028      xor     eax, eax
.text:0700702A      repne scasb
.text:0700702C      not     ecx
.text:0700702E      dec     ecx
.text:0700702F      mov     [ebp+var_DecodedLen], 104h ; max decoded len: 0x104 bytes
.text:07007036      push    ecx
.text:07007037      push    edx                        ; attacked-controlled
.text:07007037                                         ; base64-encoded data
.text:07007038      call    base64_decode(uchar const *,int,uchar *,int *)
.text:0700703D      mov     ecx, [ebp+var_DecodedLen]
.text:07007040      lea     edx, [ebp+passwd_5C]       ; 0x5C bytes to function return address:
.text:07007040                                         ; stack overflow!!!
.text:07007043      lea     eax, [ebp+user_9C]
.text:07007049      push    edx
.text:0700704A      mov     [ebp+ecx+b64Decoded], 0
.text:07007052      lea     ecx, [ebp+b64Decoded]      ; attacker-controlled; up to 0x104 bytes
.text:07007058      push    eax
.text:07007059      push    ecx
.text:0700705A      call    GetUserPasswd(char *,char *,char *)

The GetUserPasswd function expects the Base64-decoded data to be in the form of 'USER:PASSWD' and copies the 'user' part to 'user' buffer on the stack and the 'passwd' part to the 'passwd' buffer on the stack. Because both the 'user' and the 'passwd' buffers can be smaller than the input data, a stack-based buffer overflow can occur.

The crash of webvrpcs.exe is shown in Windbg and the Windbg !exploitable extension shows the vulnerability is exploitable:
0:014> g
ModLoad: 00470000 00480000   C:\WebAccess\Node\viewsrv.dll
(1be4.bfc): Access violation - code c0000005 (first chance)
First chance exceptions are reported before any exception handling.
This exception may be expected and handled.
*** WARNING: Unable to verify checksum for C:\WebAccess\Node\BwPAlarm.dll
eax=00000000 ebx=00000000 ecx=ffffffff edx=02e3ea00 esi=004bb130 edi=41414141
eip=070012e7 esp=02e3e9e8 ebp=02e3f708 iopl=0         nv up ei ng nz na pe nc
cs=0023  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00010286
BwPAlarm+0x12e7:
070012e7 f2ae            repne scas byte ptr es:[edi]
0:012> kb
ChildEBP RetAddr  Args to Child              
02e3eaac 070070a5 41414141 41414152 41414162 BwPAlarm+0x12e7
00000000 00000000 00000000 00000000 00000000 BwPAlarm+0x70a5
0:012> .load msec.dll
0:012> !exploitable

!exploitable 1.6.0.0
Exploitability Classification: EXPLOITABLE
Recommended Bug Title: Exploitable - Exception Handler Chain Corrupted starting at BwPAlarm+0x00000000000012e7 (Hash=0xdfb6d31b.0xf5f1cde0)

Corruption of the exception handler chain is considered exploitable

Solution

Upgrade to version 8.4.2 or later.

Disclosure Timeline

07/03/2019 - Vulnerability discovered
07/16/2019 - Vulnerability reported. 90-day date set to October 14, 2019.
07/16/2019 - Advantech will look into the issue.
07/30/2019 - Tenable asks for an update.
07/31/2019 - Advantech will fix in version 8.4.2.
07/31/2019 - Tenable asks when the 8.4.2 release is planned for.
08/13/2019 - Tenable follows up. Asks when 8.4.2 will be released.
08/13/2019 - Advantech says target release date is Aug 30.
08/26/2019 - Tenable follows up to verify if 8.4.2 is still planned for Aug 30.
08/26/2019 - Release might be delayed until Sept 6.
09/03/2019 - Tenable asks if release is still planned for Sept 6.
09/04/2019 - New estimated release date is Sept 11.
09/10/2019 - Advantech posts version 8.4.2 on their downloads page.
09/11/2019 - Advantech says they are having an issue with their patch download link.
09/12/2019 - Advantech says they are still having an issue with their patch download link.
09/12/2019 - Tenable will remove specific details from the advisory.
09/16/2019 - Advantech advises that their download link is working. Tenable confirms.

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]

Try for Free Buy Now

Try Tenable.io

FREE FOR 60 DAYS

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. Sign up now.

Buy Tenable.io

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.

65 assets

$2,275.00

Buy Now

Try for Free Buy Now

Try Nessus Professional Free

FREE FOR 7 DAYS

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

Buy Nessus Professional

Nessus® is the most comprehensive vulnerability scanner on the market today. 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, email, community and chat support 24 hours a day, 365 days a year. Full details here.

Try for Free Buy Now

Try Tenable.io Web Application Scanning

FREE FOR 60 DAYS

Enjoy full access to our latest web application scanning offering designed for modern applications as part of the Tenable.io 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.

Buy Tenable.io Web Application 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.00

Buy Now

Try for Free Contact Sales

Try Tenable.io Container Security

FREE FOR 60 DAYS

Enjoy full access to the only container security offering integrated into a vulnerability management platform. Monitor container images for vulnerabilities, malware and policy violations. Integrate with continuous integration and continuous deployment (CI/CD) systems to support DevOps practices, strengthen security and support enterprise policy compliance.

Buy Tenable.io Container Security

Tenable.io Container Security seamlessly and securely enables DevOps processes by providing visibility into the security of container images – including vulnerabilities, malware and policy violations – through integration with the build process.

Learn More about Industrial Security

Get a Demo of Tenable.sc

Please fill out the form below with your contact information and a sales representative will contact you shortly to schedule a demo. You may also include a short comment (limited to 255 characters). Please note that fields with asterisks (*) are mandatory.