Skip to main content

CVE-2025-46340: CWE-20: Improper Input Validation in misskey-dev misskey

High
VulnerabilityCVE-2025-46340cvecve-2025-46340cwe-20cwe-116
Published: Mon May 05 2025 (05/05/2025, 18:35:37 UTC)
Source: CVE
Vendor/Project: misskey-dev
Product: misskey

Description

Misskey is an open source, federated social media platform. Starting in version 12.0.0 and prior to version 2025.4.1, due to an oversight in the validation performed in `UrlPreviewService` and `MkUrlPreview`, it is possible for an attacker to inject arbitrary CSS into the `MkUrlPreview` component. `UrlPreviewService.wrap` falls back to returning the original URL if it's using a protocol that is likely to not be understood by Misskey, IE something other than `http` or `https`. This both can de-anonymize users and_allow further attacks in the client. Additionally, `MkUrlPreview` doesn't escape CSS when applying a `background-image` property, allowing an attacker to craft a URL that applies arbitrary styles to the preview element. Theoretically, an attacker can craft a CSS injection payload to create a fake error message that can deceive the user into giving away their credentials or similar sensitive information. Version 2025.4.1 contains a patch for the issue.

AI-Powered Analysis

AILast updated: 07/05/2025, 19:41:03 UTC

Technical Analysis

CVE-2025-46340 is a high-severity vulnerability affecting the open-source federated social media platform Misskey, specifically versions from 12.0.0 up to but not including 2025.4.1. The flaw arises from improper input validation and insufficient escaping of CSS in the components `UrlPreviewService` and `MkUrlPreview`. When Misskey attempts to generate URL previews, the `UrlPreviewService.wrap` method falls back to returning the original URL if the protocol is not recognized (i.e., not http or https). This fallback behavior can inadvertently expose user information, potentially de-anonymizing users. More critically, the `MkUrlPreview` component applies a CSS `background-image` property without escaping CSS content, allowing an attacker to inject arbitrary CSS styles. This CSS injection can be exploited to craft malicious payloads that manipulate the appearance of the preview element, including creating fake error messages or UI elements designed to deceive users into divulging sensitive information such as credentials. The vulnerability is rooted in CWE-20 (Improper Input Validation) and CWE-116 (Improper Encoding or Escaping of Output). The vulnerability does not require authentication or user interaction to be exploited, and the CVSS 3.1 base score is 7.2, reflecting a high severity with network attack vector, low attack complexity, no privileges required, and no user interaction needed. Although no known exploits are currently reported in the wild, the potential for phishing-like attacks and user deception is significant. The issue was patched in Misskey version 2025.4.1.

Potential Impact

For European organizations using Misskey as a federated social media platform, this vulnerability poses several risks. The CSS injection can lead to UI manipulation, enabling attackers to conduct phishing attacks within the platform by displaying fake error messages or login prompts, potentially harvesting user credentials or other sensitive data. The fallback behavior that leaks original URLs with unsupported protocols can de-anonymize users, undermining privacy guarantees critical in Europe, especially under GDPR regulations. This could result in reputational damage, regulatory penalties, and loss of user trust. Given Misskey's federated nature, a compromised instance could propagate malicious content or misinformation across the network, amplifying the impact. Organizations relying on Misskey for internal or community communications may face confidentiality breaches and social engineering risks. The lack of authentication or user interaction requirements lowers the barrier for exploitation, increasing the threat landscape.

Mitigation Recommendations

European organizations should immediately upgrade all Misskey instances to version 2025.4.1 or later, where the vulnerability is patched. Until upgrades are completed, administrators should consider disabling URL preview features or restricting the protocols accepted by `UrlPreviewService` to only safe protocols (http and https) to prevent fallback to unrecognized protocols. Implement Content Security Policy (CSP) headers that restrict inline styles and disallow unsafe CSS to mitigate CSS injection impact. Conduct user awareness training to recognize suspicious UI elements and phishing attempts within the platform. Regularly audit and monitor Misskey logs for unusual URL preview requests or anomalous CSS payloads. For organizations running public-facing instances, consider deploying Web Application Firewalls (WAF) with custom rules to detect and block suspicious URL preview payloads. Finally, review federation peers and restrict federation with untrusted or unknown instances to reduce exposure to malicious content propagation.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
GitHub_M
Date Reserved
2025-04-22T22:41:54.912Z
Cisa Enriched
true
Cvss Version
3.1
State
PUBLISHED

Threat ID: 682d981dc4522896dcbdaf1c

Added to database: 5/21/2025, 9:08:45 AM

Last enriched: 7/5/2025, 7:41:03 PM

Last updated: 8/11/2025, 2:43:29 AM

Views: 15

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats