Skip to content
Path traversal Write-up Intermediate

docAssembling Exploits for RCE

Docassemble's /interview endpoint accepted a file path in the 'i' or 'state' parameter without sanitisation, allowing unauthenticated attackers to read arbitrary files such as /etc/passwd and the configuration file containing secrets. By uploading a file beginning with a Jinja directive and then reading it through the same path traversal, an attacker could achieve server-side template injection and remote code execution.

Riyush Ghimire Follow

Published on tantosec.com

This post examines CVE-2024-27292 in Docassemble, revealing an unauthenticated path traversal flaw that exposes sensitive files and secrets, leading to privilege escalation and template injection, enabling remote code execution. It details the vulnerability, its impact, and the exploitation steps.

Riyush Ghimire, on tantosec.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

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

How it worked

Impact

An unauthenticated attacker could read sensitive files and secrets, potentially escalate to a privileged session, and achieve remote code execution by chaining the path traversal with an uploaded Jinja template.

What the attacker needed

Network access to the Docassemble instance; ability to upload a file (for the SSTI chain)

The fix

CVE-2024-27292 was fixed in Docassemble version 1.4.97 and above.

How it was found

  1. Navigate to the /interview endpoint with the 'i' parameter set to a system file path such as /etc/passwd.
  2. Alternatively, use the 'state' parameter with a base64-encoded file path.
  3. Read the Docassemble configuration file to obtain secrets such as API keys and the Flask secret key.
  4. Extract an API key from the access log if it appears in a URL.
  5. Use the API key to obtain a session cookie for a privileged user.
  6. Upload a file whose first line is a Jinja directive, then access it through the path traversal to trigger template rendering and code execution.

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 write-up has not been written yet. The Original tab links to the source.

A path traversal bug lets someone trick a web app into reading files it should not, by putting a file path like /etc/passwd into a URL parameter. Here the app also rendered any file that started with a special Jinja marker, so an uploaded file could become a template that runs code on the server.

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 Riyush Ghimire

View all

2 more disclosed reports, best first.

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.