Skip to content
Path traversal Write-up Intermediate

CVE-2024-27292: docAssembling exploits for RCE

Docassemble's /interview route passed a user-supplied file path into a file-reading function without validation, allowing unauthenticated attackers to read arbitrary files such as /etc/passwd and the configuration file holding secrets. Reading log files could expose API keys, which could then be used to obtain a privileged session and, via template injection, execute code on the server.

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

Root cause

The application took a user-controlled value from the i or state URL parameter, resolved it to an absolute file path, and read that file without restricting it to the intended interview directory.

Impact

An unauthenticated attacker could read arbitrary files including secrets and API keys, and where those keys are unrestricted and belong to a privileged user, could gain that user's session and achieve code execution; the template injection itself was not accepted as a vulnerability by the developer.

What the attacker needed

No authentication needed; API key present in logs and unrestricted; privileged account for code execution

The fix

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

How it was found

  1. Request the interview route with the i parameter set to a system file path and observe the file contents returned.
  2. Repeat the same request using the state parameter with a base64-encoded file path.
  3. Request the Docassemble configuration file through the same parameter to read stored secrets.
  4. Request the access log file to extract an API key used in a URL.
  5. Use the extracted API key against an API endpoint to obtain a session cookie.
  6. With a privileged session, use a template injection payload in a playground interview to run a command on the server.

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.

Docassemble is a web app that builds documents from guided interviews. A part of the site that loads an interview file accepted a file path from the visitor and read whatever file that path pointed to, so anyone could ask the server to show files it should keep private, like system password lists or its own settings file. Those settings can contain secret keys, and some log files contain API keys that let an attacker log in as a more powerful user.

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.