Core Security
info@coresecurity.com  | +1.617.399.6980 | Contact Us   Core Blog Core Blog Twitter LinkedIn youtube
Advisories
SHARE
Anzio Web Print Object Buffer Overflow


Core Security Technologies - CoreLabs Advisory
http://www.coresecurity.com/corelabs/

Advisory Information

Title: Anzio Web Print Object Buffer Overflow
Advisory ID: CORE-2008-0624
Advisory URL: http://www.coresecurity.com/content/anzio-web-print-object-buffer-overflow
Date published: 2008-08-20
Date of last update: 2008-08-20
Vendors contacted: Anzio
Release mode: Coordinated release

Vulnerability Information

Class: Buffer overflow
Remotely Exploitable: Yes (client side)
Locally Exploitable: No
Bugtraq ID: 30545
CVE Name: CVE-2008-3480

Vulnerability Description

Anzio Web Print Object (WePO) is a Windows ActiveX web page component that, when placed on a web page can "push" a print job from a file or web server to a user's local printer without having to display the HTML equivalent to that user. By placing WePO code on a web page, you can provide a method whereby the viewer of that web page can request a local print of a host resident print job, archived print job or a report stream through a server-side script request.

Anzio Web Print Object is vulnerable to a buffer overflow attack, which can be exploited by remote attackers to execute arbitrary code, by providing a malicious web page with a long "mainurl" parameter for the WePO ActiveX component.

Vulnerable packages

  • Anzio Web Print Object 3.2.19
  • Anzio Web Print Object 3.2.24
  • Anzio Print Wizard Server Edition 3.2.19
  • Anzio Print Wizard Personal Edition 3.2.19
  • Older versions are probably affected too, but were not checked.
  • Non-vulnerable packages

  • Anzio Web Print Object 3.2.30
  • Vendor Information, Solutions and Workarounds

    Update to Anzio Web Print Object 3.2.30, available at http://www.anzio.com/download-wepo.htm, or visit the vendor homepage at http://www.anzio.com.

    Credits

    This vulnerability was discovered and researched by Francisco Falcon from Core Security Technologies.

    Technical Description / Proof of Concept Code

    The WePO ActiveX component has a parameter named "mainurl" that indicates the local file name or the URL from where to retrieve the content to print:

    [+ full code]

    WePO takes the value of "mainurl" parameter in OLECHAR format and transforms it to a BSTR string using the API SysAllocStringLen from oleaut32.dll. The pointer to a BSTR string returned by SysAllocStringLen is stored in the stack.

    [+ full code]

    After that, it copies "mainurl" value in ASCII format to a buffer on the stack, without validating its length.

    [+ full code]

    By supplying a web page with a long "mainurl" value, an attacker can overflow the stack buffer mentioned above and overwrite the SEH (Structured Exception Handler), enabling arbitrary code execution on the machine that has the WePO ActiveX component installed. The Structured Exception Handler can be overwritten by providing a "mainurl" value with 396 bytes as padding, plus 4 specially chosen bytes that will replace the original SEH, allowing execution of arbitrary code with the privileges of the current user.

    When providing such a long string as value for the "mainurl" parameter, an access violation exception is generated when WePO object calls the API SysFreeString to deallocate the BSTR string that was previously created with SysAllocStringLen. The exception raises because the original pointer to the BSTR string was replaced with 4 junk bytes from the 396 padding bytes mentioned above.

    [+ full code]

    At this point, the Structured Exception Handler is already controlled by the attacker, so when exception raises the execution is transferred to an arbitrary memory address chosen by the person providing the malicious web page.

    By adding JavaScript code in the malicious web page, the attacker can use a technique called Heap Spray, that fills the heap of the browser process with his payload, and then jump to the arbitrary code located in the process heap.

    The following Python code will generate an HTML file that, when opened on a machine with Web Print Object installed, will launch the Windows Calculator as a proof of the possibility to execute arbitrary code on a machine that has the vulnerable ActiveX component installed. This Proof of Concept was tested in Windows XP Professional SP2 with Internet Explorer 6.0.2900.2180, and Windows XP Professional SP3 with Internet Explorer 6.0.2900.3264, but can be easily modified to work in other platforms.

    [+ full code]

    Report Timeline

    • 2008-06-27: Core Security Technologies notifies Anzio that there is a vulnerability in Web Print Object (WePO).
    • 2008-06-28: Vendor acknowledges notification.
    • 2008-07-01: Core sends an advisory draft, containing technical details and Proof of Concept code for the vulnerability.
    • 2008-07-08: Core asks for confirmation of the vulnerability, and reminds the vendor that the advisory's publication date is set to July 14th, 2008.
    • 2008-07-08: Vendor asks Core to resend the report.
    • 2008-07-14: Core sends (again) the advisory draft, and asks for information about the vendor's plan for fixing the vulnerability.
    • 2008-07-21: Core asks for updated information, and notifies the vendor that the advisory's publication date has been rescheduled for August 4th.
    • 2008-07-21: Vendor asks Core to resend the report.
    • 2008-07-21: Core sends (for the third time) the advisory draft as a compressed file.
    • 2008-07-21: Vendor confirms reception of the reports and states that the problem has been identified.
    • 2008-07-31: Core asks for updated information about the release of fixed versions (no reply received).
    • 2008-08-04: Core asks for updated information, and reschedules the publication of the advisory to August 11th 2008 (no reply received).
    • 2008-08-11: Core makes a phone call to the vendor, asking one more time for a release date of fixed versions. Vendor informs that new versions will be released during the week.
    • 2008-08-15: Vendor releases fixed version Anzio Web Print Object 3.2.30.
    • 2008-08-20: Advisory CORE-2008-0624 is published.

    About CoreLabs

    CoreLabs, the research center of Core Security Technologies, is charged with anticipating the future needs and requirements for information security technologies. We conduct our research in several important areas of computer security including system vulnerabilities, cyber attack planning and simulation, source code auditing, and cryptography. Our results include problem formalization, identification of vulnerabilities, novel solutions and prototypes for new technologies. CoreLabs regularly publishes security advisories, technical papers, project information and shared software tools for public use at: http://www.coresecurity.com/corelabs/.

    About Core Security Technologies

    Core Security Technologies develops strategic solutions that help security-conscious organizations worldwide develop and maintain a proactive process for securing their networks. The company's flagship product, CORE IMPACT, is the most comprehensive product for performing enterprise security assurance testing. CORE IMPACT evaluates network, endpoint and end-user vulnerabilities and identifies what resources are exposed. It enables organizations to determine if current security investments are detecting and preventing attacks. Core Security Technologies augments its leading technology solution with world-class security consulting services, including penetration testing and software security auditing. Based in Boston, MA and Buenos Aires, Argentina, Core Security Technologies can be reached at 617-399-6980 or on the Web at http://www.coresecurity.com.

    Disclaimer

    The contents of this advisory are copyright (c) 2008 Core Security Technologies and (c) 2008 CoreLabs, and may be distributed freely provided that no fee is charged for this distribution and proper credit is given.

    PGP/GPG Keys

    This advisory has been signed with the GPG key of Core Security Technologies advisories team, which is available for download at http://www.coresecurity.com/files/attachments/core_security_advisories.asc.

    Related Content