Miggo Logo

CVE-2024-47822:
Directus inserts access token from query string into logs

4.2

CVSS Score
3.1

Basic Information

EPSS Score
0.07933%
Published
4/14/2025
Updated
4/14/2025
KEV Status
No
Technology
TechnologyJavaScript

Technical Details

CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:H/UI:R/S:U/C:H/I:N/A:N
Package NameEcosystemVulnerable VersionsFirst Patched Version
@directus/apinpm< 21.0.021.0.0

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability lies in the logging mechanism not redacting the 'access_token' from the request query parameters when the log style is set to 'raw'. The provided commit patch clearly shows that the createExpressLogger function in api/src/logger/index.ts is modified to add 'req.query.access_token' to the list of redacted paths. This indicates that prior to this patch, this function was responsible for the logging behavior that led to the vulnerability. The function itself processes the request object (implicitly, as it configures the logger for Express which handles requests) and, in its vulnerable state, would allow the access token to be logged. The logger configured by this function would be active during the request lifecycle where the access_token is present in the query string, and would write it to the logs if LOG_STYLE is 'raw'. Therefore, createExpressLogger is the key function related to the vulnerability, as it defines the logging behavior. During exploitation, the logger instance created and configured by this function would be the one writing the sensitive data to the logs. While createExpressLogger itself might not appear directly in every stack trace at the exact moment of logging, it's the function that sets up the vulnerable logging configuration. The actual logging would be performed by the pino-http middleware that uses these configurations, but createExpressLogger is the Directus function where the vulnerability (lack of redaction) originates from a configuration standpoint.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

### Summ*ry ****ss tok*n *rom qu*ry strin* is not r****t** *n* is pot*nti*lly *xpos** in syst*m lo*s w*i** m*y ** p*rsist**. ### **t*ils T** ****ss tok*n in `r*q.qu*ry` is not r****t** w**n t** `LO*_STYL*` is s*t to `r*w`. I* t**s* lo*s *r* not prop

Reasoning

T** vuln*r**ility li*s in t** lo**in* m****nism not r****tin* t** '****ss_tok*n' *rom t** r*qu*st qu*ry p*r*m*t*rs w**n t** lo* styl* is s*t to 'r*w'. T** provi*** *ommit p*t** *l**rly s*ows t**t t** `*r**t**xpr*ssLo***r` *un*tion in `*pi/sr*/lo***r/