Back to Blog
high SEVERITY7 min read

How Denial of Service via Specific Input Sequence happens in JavaScript (marked) and how to fix it

CVE-2026-41680 is a high-severity Denial of Service vulnerability in the marked Markdown parsing library, affecting versions prior to 18.0.2. By supplying a crafted input sequence to the parser, an attacker can cause the application to hang or exhaust resources, making the frontend unavailable. Upgrading marked from 18.0.0 to 18.0.2 in both `package.json` and `package-lock.json` closes the vulnerability without affecting valid Markdown rendering.

O
By Orbis AppSec
•Technically reviewed by Anupam Mediratta•Published August 26, 2026•Reviewed August 26, 2026

Answer Summary

CVE-2026-41680 is a Denial of Service (CWE-400: Uncontrolled Resource Consumption) vulnerability in the marked JavaScript Markdown library (versions < 18.0.2). When a specially crafted input sequence is passed to the marked parser, it can trigger pathological processing that exhausts CPU or memory resources, crashing or freezing the frontend application. The fix is to upgrade marked to 18.0.2 by updating the version constraint in `package.json` and regenerating `package-lock.json`, ensuring the patched parsing logic handles malicious input sequences gracefully.

Vulnerability at a Glance

cweCWE-400
fixUpgrade marked from 18.0.0 to 18.0.2 in package.json and package-lock.json
riskAttackers can crash or freeze the frontend by submitting crafted Markdown input
languageJavaScript / Node.js
root causemarked 18.0.0 contains a parsing path that enters pathological processing on specific input sequences
vulnerabilityDenial of Service via specific input sequence

The Risk Hiding in Your Markdown Renderer

If your React frontend lets users write or submit Markdown—think comments, documentation editors, chat messages, or configuration notes—the library that parses that Markdown is directly in the path of untrusted input. In this application's frontend, marked is that library, and version 18.0.0 contains a high-severity Denial of Service vulnerability tracked as CVE-2026-41680.

The Trivy scanner flagged the vulnerable version pinned in frontend/package-lock.json, and an automated pull request was opened to upgrade to the patched release. This post explains exactly what the vulnerability is, how an attacker could exploit it, and what the two-file change does to close it.


The Vulnerability Explained

What Goes Wrong in marked 18.0.0

CVE-2026-41680 is a Denial of Service via specific input sequence in the marked Markdown parsing library. The root cause is a parsing path in marked 18.0.0 that, when fed a carefully constructed sequence of characters, enters a state of pathological processing—consuming CPU cycles or memory far beyond what any legitimate Markdown document would require.

This class of vulnerability is catalogued as CWE-400: Uncontrolled Resource Consumption. The parser does not adequately bound the resources it allocates or the work it performs when encountering the triggering input pattern.

The vulnerable declaration in frontend/package-lock.json (before the fix) was:

"node_modules/marked": {
  "version": "18.0.0",
  "resolved": "https://registry.npmjs.org/marked/-/marked-18.0.0.tgz",
  "integrity": "sha512-2e7Qiv/HJSXj8rDEpgTvGKsP8yYtI9xXHKDnrftrmnrJPaFNM7VRb2YCzWaX4BP1iCJ/XPduzDJZMFoqTCcIMA==",
  "bin": {
    "marked": "bin/marked.js"
  }
}

And in frontend/package.json:

"marked": "^18.0.0"

The ^18.0.0 semver range would allow npm to resolve a newer patch version—but because package-lock.json had 18.0.0 pinned with a specific integrity hash, the vulnerable version was locked in place and would not be updated without an explicit change.

How an Attacker Could Exploit This

Consider a frontend feature that accepts user-supplied Markdown—a comment field, a documentation editor, or a live-preview input box. The application passes that content directly to marked for rendering. An attacker does not need any special privileges; they only need to be able to submit input.

By sending a POST request with a body containing the specific input sequence that triggers the DoS condition:

POST /api/comments
Content-Type: application/json

{
  "body": "<crafted_sequence_triggering_CVE-2026-41680>"
}

The frontend's Markdown rendering pipeline—or any server-side use of the same marked dependency—begins processing the input and either:

  1. Spins the event loop with a CPU-intensive parsing loop, blocking all other requests, or
  2. Exhausts heap memory, causing the Node.js process to crash with an out-of-memory error.

In a single-threaded Node.js environment, either outcome effectively takes the entire frontend service offline for every user until the process is restarted. Because the trigger is an input sequence rather than a volume attack, this can be achieved with a single, small HTTP request—no botnet required.


The Fix

What Changed and Why Both Files Matter

The fix required changes to exactly two files: frontend/package.json and frontend/package-lock.json.

frontend/package.json — updating the version constraint:

-    "marked": "^18.0.0",
+    "marked": "^18.0.2",

This shifts the minimum acceptable version to 18.0.2, ensuring that any fresh npm install will not resolve to the vulnerable 18.0.0 or 18.0.1.

frontend/package-lock.json — pinning the patched release:

 "node_modules/marked": {
-  "version": "18.0.0",
-  "resolved": "https://registry.npmjs.org/marked/-/marked-18.0.0.tgz",
-  "integrity": "sha512-2e7Qiv/HJSXj8rDEpgTvGKsP8yYtI9xXHKDnrftrmnrJPaFNM7VRb2YCzWaX4BP1iCJ/XPduzDJZMFoqTCcIMA==",
+  "version": "18.0.2",
+  "resolved": "https://registry.npmjs.org/marked/-/marked-18.0.2.tgz",
+  "integrity": "sha512-NsmlUYBS/Zg57rgDWMYdnre6OTj4e+qq/JS2ot3KrYLSoHLw+sDu0Nm1ZGpRgYAq6c+b1ekaY5NzVchMCQnzcg==",
+  "license": "MIT",
   "bin": {
     "marked": "bin/marked.js"
   }
 }

The lock file update is critical. Without it, even if package.json specifies ^18.0.2, the lock file's pinned integrity hash for 18.0.0 would continue to be used in CI pipelines and production deployments that run npm ci (which respects the lock file exactly). Updating both files ensures that every environment—local development, CI, and production—installs the patched version.

The new integrity hash sha512-NsmlUYBS/... cryptographically verifies that the installed tarball is exactly marked@18.0.2 from the npm registry, preventing supply-chain substitution attacks.

What the Patch Does Inside marked

The 18.0.2 release tightens the parser's handling of the specific input sequences that trigger pathological processing. The fix introduces bounds on the internal parsing state so that the problematic input path terminates in bounded time rather than running indefinitely. Valid Markdown documents—headings, lists, code blocks, links, emphasis—are processed identically to before; only the malicious edge-case input is handled differently.


Key Takeaways

  • package-lock.json must be updated alongside package.json: changing only the version range in package.json leaves the vulnerable version pinned in the lock file and deployed via npm ci.
  • marked 18.0.0 is unsafe for any user-submitted Markdown: the DoS trigger requires no authentication and can be sent in a single small HTTP request, making exposure proportional to how widely the input field is accessible.
  • Trivy's dependency scanning caught a pinned vulnerable version that semver range semantics alone would not have resolved—demonstrating why lock-file-aware scanners are necessary.
  • Input length limits are a valuable complement to patching, not a replacement: they reduce the attack surface for any future parsing vulnerabilities in the same code path.
  • The ^18.0.2 constraint ensures that future patch releases (e.g., 18.0.3) will be picked up automatically, while still preventing a downgrade to the vulnerable 18.0.0.

How Orbis AppSec Detected This

  • Source: User-controlled Markdown content submitted through the frontend application's input fields
  • Sink: The marked.parse() call consuming the untrusted input, resolved to marked@18.0.0 as pinned in frontend/package-lock.json
  • Missing control: No version constraint or integrity check preventing the vulnerable 18.0.0 release from being installed; no runtime input bounding before the parse call
  • CWE: CWE-400 — Uncontrolled Resource Consumption
  • Fix: Upgraded marked from 18.0.0 to 18.0.2 in both frontend/package.json and frontend/package-lock.json, replacing the vulnerable integrity hash with the verified hash for the patched release

Orbis AppSec automatically detected this vulnerability and opened a pull request with the fix. Try Orbis AppSec on your repositories to find and fix issues like this automatically.


Conclusion

CVE-2026-41680 is a concrete reminder that Markdown parsers sit directly in the path of untrusted input and carry the same security obligations as any other input-processing component. The vulnerability in marked 18.0.0 required nothing more than a crafted string to take down a frontend service—no authentication, no elevated privileges, no volume.

The fix is a two-line version bump across two files, but the lesson is broader: lock files need to be treated as security-sensitive artifacts, dependency scanners need to run against them continuously, and any library that processes user input needs to be kept current. Upgrading to marked 18.0.2 closes this specific door; the practices above keep future doors from opening unnoticed.


Prevention and further reading

View the Security Fix

Check out the pull request that fixed this vulnerability

View PR #10

Related Articles

high

MapManager.get() Race Condition Duplicates API Requests

The MapManager's `get(mapUid, cache)` method used a check-then-act pattern that permitted multiple concurrent requests to pass the cache miss check simultaneously, triggering redundant API calls and risking cache corruption. The fix introduces a `_pending` promise map to deduplicate in-flight fetches for identical map UIDs.

critical

Lampa Desktop Auto-Update Heuristic Bypass: Execution of Unverified

Lampa Desktop's auto-update mechanism downloaded JavaScript and CSS from `raw.githubusercontent.com` using only heuristic validation—file size thresholds and string pattern matching—that attackers could trivially satisfy. The fix introduces cryptographic integrity verification by cross-referencing Git blob hashes from the GitHub Contents API, ensuring downloaded code matches the repository's authoritative state before execution.

high

adm-zip 0.6.0 Preserves SUID Bits From ZIPs: CVE-2026-102282

The `adm-zip` dependency resolved to 0.6.0 in this project's dependency tree, a version affected by CVE-2026-102282: during extraction it applies the Unix permission bits stored in each ZIP entry's external file attributes verbatim, including the setuid (`04000`), setgid (`02000`), and sticky bits. An attacker who controls an archive passed to `extractAllTo()` or `extractEntryTo()` can therefore have the extractor create a setuid binary owned by whatever user the extraction process runs as. The

high

requestInput() Type Confusion: NaN and Object Bypass in JavaScript

The `requestInput()` utility function lacked validation on its `type` parameter and failed to handle `NaN` results from float conversions, creating a type confusion weakness. An attacker could supply malformed inputs that propagate unhandled `NaN` values or unexpected object types through the type system. The fix adds explicit guards against `NaN` type parameters and rejects non-primitive type values.

critical

No Rate Limit on /api/uploads/presign Enables DoS

The `/api/uploads/presign` endpoint accepted unlimited concurrent requests to generate storage presigned URLs, giving an attacker a free lever to exhaust storage-provider quotas and server resources. The fix adds an `express-rate-limit` middleware capping each client to 30 requests per minute on that route.

high

CVE-2026-54673: builder-util-runtime Leaks Auth Headers on Redirect

electron-updater and electron-builder rely on builder-util-runtime to fetch update manifests and artifacts over HTTP. A flaw in that shared HTTP executor allowed credential headers attached to the original update-feed request to be re-sent after a redirect, exposing them to any host the redirect pointed to. The project fixes this by upgrading builder-util-runtime to 9.7.0 and collapsing a duplicate, older copy of the package that electron-updater had pinned on its own.