Note Mark has Stored XSS via Unrestricted Asset Upload
A stored same-origin XSS vulnerability allows any authenticated user to upload an HTML, SVG, or XHTML file as a note asset and have it executed in a victim’s browser under the application’s origin. Because the application serves these files inline without a safe content type and without nosniff, browsers can sniff and render active content, giving the attacker access to authenticated Note Mark API actions as the victim.
This issue results from three compounding flaws in the asset handling and delivery path.
The asset delivery route can be used to deliver attacker-controlled uploaded content directly to a victim by URL.
Relevant route:
handlers/assets.go:40```go
huma.Get(api, "/api/notes/{noteID}/assets/{assetID}", h.GetNoteAssetContentByID)
```
This makes the uploaded asset reachable by direct navigation, which provides the delivery mechanism for the payload.
Content-TypeThe asset handler relies on h2non/filetype for content-type detection:
handlers/assets.go:147```go
kind, _ := filetype.Match(buf)
if kind != filetype.Unknown {
contentType = kind.MIME.Value
}
```
The detection library uses magic-byte matching and does not identify text-based formats such as HTML, SVG, JavaScript, XML, or XHTML. For those files, filetype.Match returns Unknown, leaving Content-Type unset or empty.
As a result, uploaded active content is served without an authoritative MIME type.
The asset response is sent with inline disposition:
handlers/assets.go:153```go
w.Header().Set("Content-Disposition", fmt.Sprintf("inline; filename=\"%s\"", asset.Name))
```
At the same time, the response does not set:
```http
X-Content-Type-Options: nosniff
```
This combination is dangerous:
Under these conditions, browsers may detect HTML or SVG content and execute embedded JavaScript. Because the asset is served from the application’s own origin, the script runs with same-origin access to the application and its authenticated APIs.
This turns an uploaded asset into a stored XSS payload that executes when a victim opens the asset URL.
The issue can be reproduced by uploading a text-based active content file such as HTML or SVG as a note asset, then opening the served asset URL in a browser and observing that script executes in the context of the application origin.
This issue can be reached over the network, attack complexity is low, an attacker needs low-level privileges on the target. A user must be tricked into taking some action. The scope is changed, meaning a successful attack can affect components beyond the vulnerable one. Rated impact: confidentiality high, integrity high, availability none.
The score comes from this vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N
CVE-2026-40262 is classified as CWE-434: Unrestricted Upload of File with Dangerous Type. Uploads are accepted without restricting type, so an executable file can be placed where the server will run it.
CVE-2026-40262 is recorded against 2 packages.
Published on 13 April 2026 and last revised on 25 June 2026. No public exploit is currently recorded for this entry. Record sourced from NVD.
github.com (Web)
nvd.nist.gov (Advisory)
github.com (Web)
github.com (Package)
github.com (Web)
github.com/enchant97/note-mark/backend has other advisories on record. If you are patching this one, these are worth checking on the same host:
These advisories are the same class of weakness (CWE-434: Unrestricted Upload of File with Dangerous Type) in other software:
Details
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N
Affected Packages
| Software | From version | Fixed in |
|---|---|---|
| github.com/enchant97/note-mark/backend | — | — |
| unknown | — | — |
References
Similar Threats
Site Security Check
CVE-2026-40262 is rated CVSS 8.7 High. BotEraser scans your installation against known CVE records and tells you whether this vulnerability applies to the versions you actually run.
Scan My Site Free →No credit card required · Results in minutes
ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.
Stay up to date with the latest from Boteraser.
We use cookies to improve your experience on our site. By using our site, you consent to cookies.
Manage your cookie preferences below:
Essential cookies enable basic functions and are necessary for the proper function of the website.
CloudFlare provides web performance and security solutions, enhancing site speed and protecting against threats.
Service URL: developers.cloudflare.com (opens in a new window)
These cookies are needed for adding comments on this website.
These cookies are used for managing login functionality on this website.
Statistics cookies collect information anonymously. This information helps us understand how visitors use our website.
Google Analytics is a powerful tool that tracks and analyzes website traffic for informed marketing decisions.
Service URL: policies.google.com (opens in a new window)
You can find more information in our Cookie Policy and Privacy Policy.