Skip to content

Directory Traversal in AiScript via `Mk:api`

Moderate
syuilo published GHSA-gmq6-738q-vjp2 May 5, 2025

Package

Misskey

Affected versions

>=12.31.0

Patched versions

2025.4.1

Description

Summary

Missing validation in Mk:api allows malicious AiScript code to access additional endpoints that it isn't designed to have access to.

Details

The missing validation allows malicious AiScript code to prefix a URL with ../ to step out of the /api directory, thereby being able to make requests to other endpoints, such as /files, /url, and /proxy.

PoC

// This doesn't actually do anything, but it shows that it's making the
// request with directory traversal if you check devtools
Mk:api('../proxy/avatar.webp?url=https%3A%2F%2Finsertdomain.name%2Fassets%2Ftwemoji%2F72x72%2F1f44b.png&avatar=1', {})

Impact

Hard to say how much a malicious actor could do with this, given that they already have access to the other API endpoints, but its better to be safe.

Severity

Moderate

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
High
Privileges required
Low
User interaction
Required
Scope
Unchanged
Confidentiality
Low
Integrity
High
Availability
None

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:L/I:H/A:N

CVE ID

CVE-2025-46559

Weaknesses

No CWEs

Credits