Skip to main content

XSS CVE-2026-40262

HIGH
Cross-site Scripting (XSS) (CWE-79)
2026-04-13 https://github.com/enchant97/note-mark GHSA-9pr4-rf97-79qh
8.7
CVSS 3.1 · Vendor: https://github.com/enchant97/note-mark
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Recon
    Authenticate with low-privilege account
  2. Delivery
    Upload malicious HTML/SVG as note asset
  3. Exploit
    Deliver asset URL to victim via social engineering
  4. Install
    Victim clicks URL while authenticated
  5. C2
    Browser sniffs content and renders inline
  6. Execute
    JavaScript executes in application origin
  7. Impact
    Exfiltrate victim data via authenticated API calls

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Output encoding, context-aware escaping
MITRE ATT&CK

2 techniques across 2 tactics: Initial Access, Execution

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Attacker must possess a valid low-privilege user account on the target Note Mark instance capable of uploading note assets (PR:L in CVSS vector confirms authentication required). Target deployment must be running Note Mark backend version prior to v0.19.2 with default asset handling configuration - no special deployment mode or non-default settings required for vulnerability to be present. Successful exploitation requires victim user interaction (UI:R): the victim must navigate to the malicious asset URL while authenticated to the application, typically via social engineering (phishing link, embedded URL in shared note content, or chat message). Browsers must perform MIME-sniffing on the response (default behavior when Content-Type is missing and X-Content-Type-Options: nosniff is not set), which is standard across Chrome, Firefox, Safari, and Edge. The attack works against default configurations serving assets from the same origin as the application; deployments using separate asset domains or strict CSP policies may limit impact. Network access vector (AV:N) means exploitation is possible over the internet without local/adjacent network access. Changed scope (S:C) indicates the vulnerability is not limited to specific features - any deployment allowing asset uploads through the /api/notes/{noteID}/assets/{assetID} endpoint is vulnerable.

Impact

CVSS 8.7 accurately reflects high real-world risk due to the changed scope (S:C) - the attacker's uploaded content executes in victims' security contexts, not just their own. Attack complexity is low (AC:L) with no special deployment conditions required beyond default asset upload functionality. However, practical exploitation requires low privileges (PR:L - valid user account) and user interaction (UI:R - victim must click malicious asset URL), which moderates immediate risk compared to unauthenticated or zero-click attacks. No EPSS, KEV, or active exploitation data provided, suggesting this was responsibly disclosed before widespread abuse. Public exploit code exists via the detailed proof-of-concept in the GitHub advisory, lowering the barrier for attackers to weaponize this issue. The technical impact is severe: confidentiality and integrity are both high (C:H/I:H) as attackers gain full API access to read/modify victim data, though availability impact is none (A:N). Real-world risk is elevated for deployments with multiple users or those handling sensitive information, as a single malicious insider or compromised low-privilege account can harvest data from all users who interact with shared notes. The availability of a vendor patch in v0.19.2 provides clear remediation, making this a high-priority upgrade for production instances. Missing data: EPSS score and SSVC decision tree not provided, preventing quantitative comparison of exploitation likelihood versus other vulnerabilities in the ecosystem.

Exploit ScenarioDerived

An attacker with a low-privilege Note Mark account creates a new note and uploads a malicious SVG file as a note asset. The SVG contains embedded JavaScript in <script> tags or event handlers. The attacker shares the direct asset URL (/api/notes/{noteID}/assets/{assetID}) with victims via phishing email, chat message, or by embedding it in shared note content. When a victim clicks the link while authenticated to Note Mark, their browser requests the asset, receives it with inline disposition and no Content-Type header, sniffs the SVG markup, and executes the embedded JavaScript in the application's origin. The attacker's script uses fetch() to call authenticated Note Mark APIs, exfiltrating the victim's private notes, personal information, and session tokens to an attacker-controlled server. Publicly available proof-of-concept exists in the GitHub advisory demonstrating the complete attack flow.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv2 – Apr 17, 2026

Stored cross-site scripting in Note Mark note-taking application allows authenticated users to execute arbitrary JavaScript in victims' browsers by uploading HTML/SVG files as note assets. The vulnerability affects the Go backend's asset delivery mechanism (github.com/enchant97/note-mark), which serves uploaded files inline without setting Content-Type headers or X-Content-Type-Options: nosniff, enabling browser MIME-sniffing attacks. Attackers with low-privilege accounts can create malicious asset URLs that, when opened by victims, execute scripts with full access to authenticated API endpoints, private notes, and user data. CVSS 8.7 (High) reflects the changed scope impact where one user's malicious upload affects other users' security context. Vendor-released patch available in v0.19.2.

Earlier versions of this analysis (1)
v1 Apr 15, 2026 - 12:35 CVSS 8.7

Stored cross-site scripting in Note Mark allows authenticated users to upload HTML/SVG files that execute JavaScript in victims' browsers under the application origin. The vulnerability stems from serving user-uploaded assets inline with empty Content-Type headers and without X-Content-Type-Options: nosniff, enabling browser content sniffing and script execution. Attackers with low-privilege accounts can access victims' private notes, profile data, and perform authenticated API actions. Vendor-released patch available in version 0.19.2. No active exploitation confirmed (not in CISA KEV), but publicly disclosed with detailed proof-of-concept.

RemediationAI

Upgrade to Note Mark v0.19.2 or later, which contains the security fix committed in 6bb62842ccb956870b9bf183629eba95e326e5e3 (release notes: https://github.com/enchant97/note-mark/releases/tag/v0.19.2, patch commit: https://github.com/enchant97/note-mark/commit/6bb62842ccb956870b9bf183629eba95e326e5e3). The patch likely implements one or more of these mitigations: setting X-Content-Type-Options: nosniff on asset responses to prevent MIME-sniffing, forcing Content-Type to application/octet-stream for unrecognized file types to trigger download instead of inline rendering, or serving user-uploaded assets from a separate sandboxed domain to break same-origin context. If immediate upgrade is not feasible, implement these compensating controls: configure a reverse proxy (nginx/Apache) to add X-Content-Type-Options: nosniff and Content-Security-Policy: default-src 'none'; sandbox headers to all /api/notes/*/assets/* responses (trade-off: breaks legitimate inline viewing of safe assets like images), restrict asset upload functionality to trusted administrative users only via application access controls (trade-off: limits core note-taking functionality), or serve assets through a dedicated CDN/subdomain with restrictive CORS policies to break same-origin access (trade-off: requires infrastructure changes and may affect application architecture). Review access logs for suspicious asset access patterns or unusual file upload activity as potential indicators of exploitation attempts during the vulnerable window.

Affected Packages

go github.com/enchant97/note-mark/backend fix: 0.0.0-20260411145018-6bb62842ccb9

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in go

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

This vulnerability exploits the interaction between Go's asset serving implementation and browser MIME-sniffing behavior. The Note Mark backend uses the h2non/filetype library for content-type detection, which relies on magic-byte matching and cannot identify text-based formats (HTML, SVG, XML, XHTML, JavaScript). When these files are uploaded, filetype.Match returns Unknown, leaving the Content-Type header empty or unset. The asset handler in handlers/assets.go serves files with Content-Disposition: inline but fails to set X-Content-Type-Options: nosniff. According to browser security specifications, when no authoritative MIME type is provided and nosniff is absent, browsers perform content sniffing to determine file types. Modern browsers can detect HTML/SVG markup patterns and execute embedded scripts. Since assets are served from the application's own origin (same-origin context) rather than a separate asset domain, any executed JavaScript inherits the full security context of the authenticated session, including cookies, localStorage, and CSRF tokens. This is a textbook CWE-79 (Improper Neutralization of Input During Web Page Generation) where user-controlled content becomes executable code due to improper content handling.

Know when the next one hits your stack

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (https://github.com/enchant97/note-mark) PRIMARY 8.7 HIGH
AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N
SUSE HIGH

Primary rating from Vendor (https://github.com/enchant97/note-mark).

CVSS VectorVendor: https://github.com/enchant97/note-mark

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

Lifecycle Timeline

3
Analysis Updated
Apr 17, 2026 - 01:29 vuln.today
v2 - CVSS changed
Patch released
Apr 13, 2026 - 19:30 nvd
Patch available
CVE Published
Apr 13, 2026 - 19:23 nvd
HIGH 8.7

DescriptionCVE.org

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

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

3. Files are rendered inline and sniffed by the browser

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:

  • 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

Executive ViewAI

Why It Matters

Note Mark note-taking application versions prior to v0.19.2 contain a stored cross-site scripting vulnerability that allows authenticated users to inject malicious scripts through HTML/SVG file uploads, compromising the security context of other users who access those assets. Any organization using Note Mark for sensitive information sharing faces risk of unauthorized access to private notes and authenticated API abuse affecting multiple team members.

Business Impact: High
Compensating Controls

Apply vendor patch to v0.19.2 or later. Interim mitigation (if patching delayed): Restrict file upload functionality to trusted administrators only; configure web server to enforce Content-Type: text/plain for all asset responses and set X-Content-Type-Options: nosniff headers globally; disable inline asset rendering and require downloads instead; implement Content Security Policy (CSP) with script-src 'none' on note-viewing pages.

Threat Intelligence Overview

EPSS Score
0.0%
Top 91% exploitable
Threat Intel
1
1 source
Data Quality
6 sources
Confidence: High
NVD CVE.org EPSS Vulnrichment GHSA Vendor GitHub

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Scheduled
Exploitation
Poc
System Exposure· derived
Open
Automatable
No
Human Impact
High
Technical Impact
Total

Priority Score

44
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +44
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.

Affected Products (CPE)CVE.org

pkg:go/github.com_enchant97_note-mark_backend

Vendor StatusVendor

SUSE

Severity: Important
Product Status
SUSE Linux Enterprise Server 16.1 Affected
SUSE Linux Enterprise Server for SAP applications 16.1 Affected
SUSE Linux Enterprise Module for Package Hub 15 SP5 Affected
SUSE Linux Enterprise Module for Package Hub 15 SP6 Affected
openSUSE Leap 15.5 Affected

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy