CVE-2026-40265: Github.com/enchant97/note mark/backend Note Mark Has Broken Access Vulnerability

MODERATE
Advisory Identifier: GHSA-p5w6-75f9-cc2p
CVSS 5.9
CWE-862
Published
Advisory Summary

CVE-2026-40265 is a MODERATE (CVSS 5.9) note mark has broken access vulnerability (CWE-862: Missing Authorization) affecting Github.com/enchant97/note mark/backend libraries in the Go ecosystem. The issue involves note mark has broken access control on asset download. Remediation is available by upgrading affected packages to version 0.0.0-20260411145023-6593898855ad.

CVE-2026-40265 at a Glance

CVE Identifier CVE-2026-40265
GHSA Identifier GHSA-p5w6-75f9-cc2p
Severity MODERATE
CVSS v3.1 Base Score 5.9
CWE Classification CWE-862: Missing Authorization
Affected Product Github.com/enchant97/note mark/backend
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 5.9

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2026-40265

To remediate this vulnerability, upgrade all affected Github.com/enchant97/note mark/backend dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/enchant97/note-mark/backend fixed: 0.0.0-20260411145023-6593898855ad
Upgrade github.com/enchant97/note-mark/backend to 0.0.0-20260411145023-6593898855ad
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/enchant97/note-mark/backend

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-40265, inspect your project dependencies for Github.com/enchant97/note mark/backend:

inspect dependencies for github.com/enchant97/note-mark/backend

Analyze the terminal output to locate any version of Github.com/enchant97/note mark/backend in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.0.0-20260411145023-6593898855ad), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-862: Missing Authorization, where the product does not perform an authorization check when an actor attempts to access a resource or perform an action. In Github.com/enchant97/note mark/backend, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary A broken access control vulnerability allows unauthenticated users to retrieve note assets directly from the asset download endpoint when they know both the note UUID and asset UUID. This exposes the full contents of private note assets without authentication, even when the associated book is not public. ### Details The issue is caused by the asset download route being registered without authentication middleware. Relevant route registration: - `handlers/assets.go`, line 40 ```go huma.Get(api, "/api/notes/{noteID}/assets/{assetID}", h.GetNoteAssetContentByID) ``` By contrast, other asset operations correctly apply authentication middleware. For example: ```go huma.Delete(api, "/api/notes/{noteID}/assets/{assetID}", h.DeleteNoteAsset, huma.WithMiddleware(h.authMiddleware.AuthRequiredMiddleware)) ``` The backend service for asset retrieval also does not enforce ownership or visibility checks. According to the provided code references, the lookup only queries the asset table by asset ID and note ID: ```sql SELECT * FROM note_assets WHERE id = ? AND note_id = ? ``` Because the retrieval path does not join against the related `notes` or `books` records, it does not verify: - whether the requester owns the parent book - whether the parent book is public or private - whether the related note has been deleted As a result, possession of a valid `noteID` and `assetID` is sufficient to retrieve the asset binary, regardless of whether the note belongs to a private book. The exploitability is constrained by identifier knowledge. Both `noteID` and `assetID` are UUIDv4 values, so blind guessing is impractical. However, the endpoint remains vulnerable whenever those identifiers are disclosed through another channel, such as leaked links, browser history, proxy logs, shared URLs, or other application behaviors that expose internal asset references. ### PoC The issue can be reproduced by creating a private note with an attached asset, then requesting the asset download endpoint without authentication using the valid `noteID` and `assetID`. The server returns the asset content even though the associated note is private. ### Impact - **Type:** Broken access control / unauthenticated information disclosure - **Who is impacted:** Any deployment exposing the affected asset download endpoint - **Security impact:** Full binary contents of private note assets can be disclosed to unauthenticated users who know the required identifiers - **Attack preconditions:** The attacker must know both the target `noteID` and `assetID`; no authentication is required - **Attack complexity:** High, because successful exploitation depends on prior disclosure of both UUIDs rather than feasible online guessing

CVE-2026-40265 Affected Github.com/enchant97/note mark/backend Versions

1 component(s)
Fixed Versions:
0.0.0-20260411145023-6593898855ad
Product / Package Ecosystem Affected Versions Fixed Version
github.com/enchant97/note-mark/backend
Go
< 0.0.0-20260411145023-6593898855ad
0.0.0-20260411145023-6593898855ad

References

Frequently Asked Questions

What is CVE-2026-40265?
CVE-2026-40265 is a security vulnerability in Github.com/enchant97/note mark/backend involving Note Mark has Broken Access Control on Asset Download under CWE-862: Missing Authorization.
Which Github.com/enchant97/note mark/backend versions are affected?
Affected versions include releases prior to 0.0.0-20260411145023-6593898855ad across affected packages: github.com/enchant97/note-mark/backend.
What version fixes CVE-2026-40265?
Upgrading to 0.0.0-20260411145023-6593898855ad (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/enchant97/note-mark/backend affected?
Yes, github.com/enchant97/note-mark/backend is affected in releases prior to 0.0.0-20260411145023-6593898855ad. Upgrade your dependency to 0.0.0-20260411145023-6593898855ad or later.
What is the CVSS score of CVE-2026-40265?
CVE-2026-40265 has a CVSS v3.1 base score of 5.9 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2026-40265?
CVE-2026-40265 is classified under CWE-862: Missing Authorization (The product does not perform an authorization check when an actor attempts to access a resource or perform an action.).
How can I check Go dependencies for CVE-2026-40265?
Run the dependency tree command: 'inspect dependencies for github.com/enchant97/note-mark/backend'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-p5w6-75f9-cc2p",
  "modified" : "2026-04-24T20:37:59Z",
  "published" : "2026-04-13T19:31:57Z",
  "aliases" : [ "CVE-2026-40265" ],
  "summary" : "Note Mark has Broken Access Control on Asset Download",
  "details" : "### Summary\nA broken access control vulnerability allows unauthenticated users to retrieve note assets directly from the asset download endpoint when they know both the note UUID and asset UUID. This exposes the full contents of private note assets without authentication, even when the associated book is not public.\n\n### Details\nThe issue is caused by the asset download route being registered without authentication middleware.\n\nRelevant route registration:\n- `handlers/assets.go`, line 40\n\n```go\nhuma.Get(api, \"/api/notes/{noteID}/assets/{assetID}\", h.GetNoteAssetContentByID)\n```\n\nBy contrast, other asset operations correctly apply authentication middleware. For example:\n\n```go\nhuma.Delete(api, \"/api/notes/{noteID}/assets/{assetID}\", h.DeleteNoteAsset,\n    huma.WithMiddleware(h.authMiddleware.AuthRequiredMiddleware))\n```\n\nThe backend service for asset retrieval also does not enforce ownership or visibility checks. According to the provided code references, the lookup only queries the asset table by asset ID and note ID:\n\n```sql\nSELECT * FROM note_assets WHERE id = ? AND note_id = ?\n```\n\nBecause the retrieval path does not join against the related `notes` or `books` records, it does not verify:\n- whether the requester owns the parent book\n- whether the parent book is public or private\n- whether the related note has been deleted\n\nAs a result, possession of a valid `noteID` and `assetID` is sufficient to retrieve the asset binary, regardless of whether the note belongs to a private book.\n\nThe exploitability is constrained by identifier knowledge. Both `noteID` and `assetID` are UUIDv4 values, so blind guessing is impractical. However, the endpoint remains vulnerable whenever those identifiers are disclosed through another channel, such as leaked links, browser history, proxy logs, shared URLs, or other application behaviors that expose internal asset references.\n\n### PoC\nThe issue can be reproduced by creating a private note with an attached asset, then requesting the asset download endpoint without authentication using the valid `noteID` and `assetID`. The server returns the asset content even though the associated note is private.\n\n### Impact\n- **Type:** Broken access control / unauthenticated information disclosure\n- **Who is impacted:** Any deployment exposing the affected asset download endpoint\n- **Security impact:** Full binary contents of private note assets can be disclosed to unauthenticated users who know the required identifiers\n- **Attack preconditions:** The attacker must know both the target `noteID` and `assetID`; no authentication is required\n- **Attack complexity:** High, because successful exploitation depends on prior disclosure of both UUIDs rather than feasible online guessing",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/enchant97/note-mark/backend"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.0.0-20260411145023-6593898855ad"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/enchant97/note-mark/security/advisories/GHSA-p5w6-75f9-cc2p"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-40265"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/enchant97/note-mark/commit/6593898855add151eb9965d96998b05e14c62026"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/enchant97/note-mark"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/enchant97/note-mark/releases/tag/v0.19.2"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-862" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-04-13T19:31:57Z",
    "nvd_published_at" : "2026-04-17T01:17:40Z"
  }
}