Skip to content

Stored XSS

High
DogukanUrker published GHSA-gj9v-qhc3-gcfx Aug 19, 2025

Package

flaskBlog (python)

Affected versions

<= 2.8.0

Patched versions

None

Description

Disclaimer

This advisor is referred to my other security advisor, where GitHub asked for separate posts in order to get CVE IDs.

Stored XSS

Description

When creating a post, there's no validation of the content of the post stored in the variable "postContent". The vulnerability arises when displaying the content of the post using the | safe filter, that tells the engine to not escape the rendered content. This can lead to a stored XSS inside the content of the post.
The code that causes the problem is in template/routes.html, line 67:
<p>{{ content | safe }} <br /></p>.

PoC

Example of a malicious user intercepting the createPost request. As can be seen in the image, the payload is a simple <script>alert("STORED XSS")</script>.

image

Going to the home of the blog after creating the post triggers the XSS.
image

Solution

Remove the | safe filter to let Flask escape the content of the post.

Severity

High

CVE ID

CVE-2025-55735

Weaknesses

Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. Learn more on MITRE.

Reliance on Untrusted Inputs in a Security Decision

The product uses a protection mechanism that relies on the existence or values of an input, but the input can be modified by an untrusted actor in a way that bypasses the protection mechanism. Learn more on MITRE.

Credits