Miggo Logo

CVE-2023-41039: Sandbox escape via various forms of "format".

8.3

CVSS Score
3.1

Basic Information

EPSS Score
0.24641%
Published
8/30/2023
Updated
11/7/2023
KEV Status
No
Technology
TechnologyPython

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:H/I:H/A:L
Package NameEcosystemVulnerable VersionsFirst Patched Version
RestrictedPythonpip<= 5.35.4
RestrictedPythonpip>= 6.0, <= 6.16.2

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from three key points:

  1. The commit modifies Guards.py to block 'format'/'format_map' on str/unicode instances and classes, indicating these methods were previously accessible.
  2. The Utilities.py patch replaces direct 'string' module access with a delegator that specifically blocks 'Formatter', showing it was previously exposed.
  3. Test cases demonstrate exploitation via str.format(), str.format_map(), and string.Formatter access. The CWE-74 classification confirms this is an injection vulnerability where format strings act as the injection vector for attribute traversal.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

### Imp**t Pyt*on's "*orm*t" *un*tion*lity *llows som*on* *ontrollin* t** *orm*t strin* to "r***" *ll o*j**ts ****ssi*l* t*rou** r**ursiv* *ttri*ut* lookup *n* su*s*ription *rom o*j**ts ** **n ****ss. T*is **n l*** to *riti**l in*orm*tion *is*losur*.

Reasoning

T** vuln*r**ility st*ms *rom t*r** k*y points: *. T** *ommit mo*i*i*s *u*r*s.py to *lo*k '*orm*t'/'*orm*t_m*p' on str/uni*o** inst*n**s *n* *l*ss*s, in*i**tin* t**s* m*t*o*s w*r* pr*viously ****ssi*l*. *. T** Utiliti*s.py p*t** r*pl***s *ir**t 'strin