Skip to content
RCE Advisory Intermediate CVE-2017-2810

Tablib Yaml Load Code Execution Vulnerability

Tablib's YAML Databook import used the unsafe yaml.load API, so a crafted YAML document could carry a Python object directive that runs arbitrary commands. An attacker who can supply a YAML file for loading could therefore execute code on the host.

Cory Duplantis Follow

Originally disclosed on Cisco Talos

High 7.5 View original

An exploitable vulnerability exists in the Databook loading functionality of Tablib. A yaml loaded Databook can execute arbitrary python commands resulting in command execution.

Cory Duplantis, on Cisco Talos

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

How it worked

Root cause

The library used the unsafe yaml.load function instead of a safe loader, allowing Python object directives in the YAML to be instantiated.

Impact

An attacker who can get a victim to load a crafted YAML Databook could execute arbitrary commands with the victim's privileges.

What the attacker needed

Victim loads attacker-supplied YAML

The fix

The unsafe loader should be replaced with yaml.safe_load so that only plain data is parsed.

How it was found

  1. Create a Tablib Databook object.
  2. Load a YAML string into it that contains a Python object directive invoking a system command.
  3. Observe the command's output, showing it executed.

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.

YAML is a text format for structured data, and some YAML parsers can also build programming-language objects. Tablib used a parser mode that builds Python objects, so a malicious file could ask it to run a system command. Anyone who loads such a file runs the attacker's command on their machine.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

More by Cory Duplantis

View all

35 more disclosed reports, best first.

More from Cisco Talos

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.