Skip to content
Access control Disclosed report Advanced CVE-2024-8238

Aim Improper Access Control

The AimQL query language in Aim 3.22.0 used an outdated RestrictedPython helper that did not block the str.format_map() method, letting an attacker read arbitrary Python object attributes. This could leak server-side secrets such as environment variables and, if the attacker could write files to a known location, load a malicious native library for code execution.

aimhubio/aim

Originally disclosed on huntr

In version 3.22.0 of aimhubio/aim, the AimQL query language uses an outdated version of the safer_getattr() function from RestrictedPython. This version does not protect against the str.format_map() method, allowing an attacker to leak server-side secrets or potentially gain unrestricted code execution. The vulnerability arises because str.format_map() can read arbitrary attributes of Python objects, enabling attackers to access sensitive variables such as os.environ. If an attacker can write files to a known location on the Aim server, they can use str.format_map() to load a malicious .dll/.so file into the Python interpreter, leading to unrestricted code execution.

From the GitHub Advisory Database (GHSA-r229-5wgf-f28g, CC BY 4.0).

The original report as published on the GitHub Advisory Database. Images and videos are our own copies; raw HTML is shown as text. View it on GitHub Advisory Database.

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

Likely the bundled RestrictedPython helper was too old and its attribute guard did not cover str.format_map(), so query expressions could reach arbitrary object attributes.

Impact

An attacker could leak server-side secrets such as environment variables and, if they can write files to a known location on the server, could load a malicious native library and gain unrestricted code execution.

What the attacker needed

Ability to submit AimQL queries; write access to a known server path for 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 report has not been written yet. The Original tab links to the source.

Aim lets people run queries written in its own small language. The sandbox meant to stop those queries from touching the rest of the server had a gap: a built-in Python string method could still reach internal objects. Through that gap an attacker could read secrets the server holds, and in some setups run their own code.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

More from aimhubio/aim

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.