Skip to main content

CVE-2026-40262 — Vulnerability in enchant97/note-mark/backend

HIGH

Note Mark has Stored XSS via Unrestricted Asset Upload

Published April 13, 2026Updated June 25, 2026Source: OSV

What Should I Do?

Address in Next Maintenance Window

Low exploitation probability (0.43%). Schedule for your next planned update.

Does your project use an affected github.com/enchant97/note-mark/backend version?

Paste your go.sum to check it for CVE-2026-40262 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.

Check my go.sum

Summary

Summary

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.

Details

This issue results from three compounding flaws in the asset handling and delivery path.

1. Asset delivery can be used as an attack vector

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
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.

2. Text-based active content is served with an empty Content-Type

The asset handler relies on h2non/filetype for content-type detection:

  • handlers/assets.go:147
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.

3. Files are rendered inline and sniffed by the browser

The asset response is sent with inline disposition:

  • handlers/assets.go:153
w.Header().Set("Content-Disposition", fmt.Sprintf("inline; filename=\"%s\"", asset.Name))

At the same time, the response does not set:

X-Content-Type-Options: nosniff

This combination is dangerous:

  • the uploaded file contains attacker-controlled active markup
  • the browser is instructed to render it inline
  • the response does not provide a trustworthy content type
  • content sniffing is not disabled

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.

PoC

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.

Impact

  • Type: Stored same-origin cross-site scripting (XSS)
  • Who is impacted: Any user who can be induced to open a malicious asset URL, and any deployment allowing asset uploads
  • Security impact: An attacker can execute JavaScript in the victim’s authenticated application context, allowing access to private notes, books, profile data, and authenticated API actions
  • Privileges required: A valid low-privilege user account capable of uploading note assets
  • User interaction: Required, because the victim must navigate to the malicious asset URL
  • Scope: Changed, because attacker-controlled content executes in the victim’s origin and impacts other users rather than remaining confined to the attacker’s own account

Advisory Timeline

  • First published April 13, 2026 (227 days ago).
  • Last revised June 25, 2026 — 73 days after initial publication.

Remediation

Upgrade to the fixed version using your package manager.

Go
Update github.com/enchant97/note-mark/backend to 0.0.0-20260411145018-6bb62842ccb9 or later
go get github.com/enchant97/note-mark/backend@v0.0.0-20260411145018-6bb62842ccb9

After upgrading, scan your dependencies again to confirm the vulnerability is resolved.

Affected Packages (1)

Affects 1 ecosystem: Go (1).

PackageFixed In
github.com/enchant97/note-mark/backend Go · Affected: All versions0.0.0-20260411145018-6bb62842ccb9

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

  • CWE-434
    Unrestricted File UploadMITRE
  • CWE-79
    Cross-site Scripting (XSS)MITRE

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 8.7 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
Low
User Interaction
Required
Scope
Changed
Confidentiality
High
Integrity
High
Availability
None

CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N

Frequently Asked Questions

What is CVE-2026-40262?
Note Mark has Stored XSS via Unrestricted Asset Upload. This vulnerability has been assigned a severity rating of HIGH (CVSS score: 8.7/10).
How do I check if my project is affected by CVE-2026-40262?
CVE-2026-40262 affects github.com/enchant97/note-mark/backend. It has a 0.4% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-40262 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
8.7

Significant impact if exploited, or exploitable with modest effort.

EPSS Score (30-day exploit probability)
0.43%
EPSS percentile: 29.3

This is a below-median EPSS score — only 29.3% of tracked vulnerabilities score at or below it, so most tracked vulnerabilities are considered more likely to be exploited than this one.

Also Known As

GHSA-9pr4-rf97-79qh
GO-2026-5295

Related CVEs

  • CVE-2026-41571
    CRITICAL

    Note Mark: OIDC-registered users authenticated by submitting password "null"

  • CVE-2026-44523
    CRITICAL

    Note Mark has a JWT Secret Weakness that allows Full Account Takeover via Token Forgery

  • CVE-2026-108262
    HIGH

    DDEV incomplete tar symlink traversal fix allows host file overwrite - Incomplete fix of CVE-2026-32885

  • CVE-2026-130007
    HIGH

    k8s-mcp-server: Missing authentication on default SSE/HTTP transport allows unauthenticated Kubernetes tool execution

Check your own dependencies

Free, with no signup for up to 10 packages.

Check my go.sum