Back to Blog
critical SEVERITY7 min read

How Insecure Update Manifest Fetching happens in Node.js and how to fix it

A critical vulnerability in `server.js` allowed the application to fetch update manifests over unencrypted HTTP connections, opening the door to man-in-the-middle attacks that could serve malicious update payloads. The fix enforces HTTPS-only connections by tightening a single regular expression in the `readUpdateManifest` function. This change closes an attack vector that could have led to remote code execution via a trojanized installer.

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

Answer Summary

This vulnerability is an insecure transport (CWE-319: Cleartext Transmission of Sensitive Information) in a Node.js application where the `readUpdateManifest` function in `server.js` accepted both `http://` and `https://` URLs for fetching update manifests. An attacker with a MITM position could intercept the unencrypted HTTP request and serve a malicious update manifest pointing to a trojanized installer, achieving RCE. The fix changes the URL validation regex from `/^https?:\/\//i` to `/^https:\/\//i`, rejecting any non-HTTPS manifest URL before a network request is made.

Vulnerability at a Glance

cweCWE-319
fixTightened regex to `^https:\/\/` so only HTTPS manifest URLs are accepted
riskAttacker-controlled update manifests can deliver trojanized installers, leading to RCE
languageJavaScript (Node.js)
root causeURL validation regex `^https?:\/\/` permitted plain HTTP manifest URLs
vulnerabilityInsecure Update Manifest Fetching over HTTP (MITM/Downgrade)

The Vulnerability: One Character That Opened the Door to RCE

The server.js file in the Mineradio application handles the critical task of fetching update manifests — the metadata documents that tell the application where to download new versions of itself. A flaw at line 567 in the readUpdateManifest function meant this process could silently fall back to an unencrypted HTTP connection, handing any network-positioned attacker the ability to serve a fake update and achieve remote code execution on every affected machine.

The root cause? A single character in a regular expression: the ? that made the s in https optional.


The Vulnerability Explained

The Vulnerable Code

Here is the readUpdateManifest function as it existed before the fix:

async function readUpdateManifest(ref) {
  const value = String(ref || '').trim();
  if (!value) throw new Error('UPDATE_MANIFEST_MISSING');
  if (/^https?:\/\//i.test(value)) {   // ← BUG: accepts http:// too
    const resp = await fetch(value, {
      headers: { 'User-Agent': `Mineradio/${APP_VERSION}` },
    });
    // ...
  }
}

The regex /^https?:\/\//i uses ? to make the s optional, meaning it matches both:

  • https://legitimate-update-server.com/manifest.json ✅
  • http://attacker-controlled.com/manifest.json ✅

This means any caller — whether from configuration, a deep link, or a network-sourced value — could pass an http:// URL and have it accepted without complaint. The application would then fetch the manifest over a completely unencrypted TCP connection.

Why This Is Critical: The Attack Scenario

Consider the following attack chain specific to this code:

  1. Initial position: An attacker gains a MITM position on the network (e.g., via a rogue Wi-Fi access point, ARP spoofing on a corporate LAN, or a compromised router). Alternatively, they obtain a TLS certificate from a rogue or compromised Certificate Authority — a real-world scenario demonstrated multiple times with DigiNotar, Comodo, and others.

  2. Interception: The application calls readUpdateManifest with an http:// manifest URL. Because there is no TLS, the request travels in plaintext. The attacker intercepts it transparently.

  3. Malicious manifest injection: The attacker responds with a crafted manifest.json that points to an attacker-controlled installer URL, with a matching (but fake) checksum if no signature verification is in place.

  4. Installer delivery: The application calls normalizeManifestUpdateInfo (visible in the diff context at line 563) to parse the attacker's manifest, then proceeds to download and execute the trojanized installer.

  5. Result: Full remote code execution under the user's account — on every machine running the affected version of Mineradio.

This is not a theoretical attack. The User-Agent header in the fetch call (Mineradio/${APP_VERSION}) even reveals the application name and version to any passive observer, making targeted exploitation trivially easy.

What Makes This Worse

  • Auto-update trust: Users implicitly trust auto-update mechanisms. A malicious update that arrives silently is far more dangerous than a phishing link a user might scrutinize.
  • No integrity check visible in the diff: The code fetches the manifest and normalizes it, but there is no visible cryptographic signature verification of the manifest content, meaning HTTPS enforcement is the only line of defense.
  • Production code: This is not test infrastructure. The server.js file is in the production codebase and runs on every end-user machine.

The Fix

The fix is surgical and precise — a one-character change to the URL validation regex:

Before

if (/^https?:\/\//i.test(value)) {

After

if (/^https:\/\//i.test(value)) {

Removing the ? quantifier makes the s in https mandatory. Any URL that begins with http:// (without the s) will no longer match the condition, and the fetch call will never be reached. The function will fall through to whatever non-URL handling exists below, or throw an appropriate error.

Why This Change Is Sufficient (and What It Doesn't Cover)

This fix is the correct and minimal change for this specific problem:

  • It rejects HTTP at the validation layer, before any network I/O occurs — the best place to stop a bad input.
  • It preserves all valid behavior: any legitimate manifest URL using https:// continues to work exactly as before.
  • It is not bypassable via case variation because the regex already uses the i (case-insensitive) flag, meaning HTTP://, Http://, and all other capitalizations are also rejected.

However, developers maintaining this code should be aware that HTTPS enforcement alone does not protect against:
- Compromised CAs issuing fraudulent certificates for the update server domain
- Manifest tampering if the update server itself is compromised

Defense-in-depth would add cryptographic signing of manifests (e.g., verifying an Ed25519 signature on the manifest JSON before parsing it).


Key Takeaways

  • The ? in https? is a silent HTTPS downgrade: In any security-sensitive URL check, https? means "HTTP is fine too." Audit every such regex in your codebase.
  • readUpdateManifest was the single point of failure: All update fetching funneled through this one function, making it both the highest-value target and the right place to add enforcement.
  • Update mechanisms deserve the same scrutiny as authentication: A compromised update channel is equivalent to a compromised login — both give an attacker persistent access.
  • The User-Agent header (Mineradio/${APP_VERSION}) advertised the target: Over HTTP, this header is visible to any passive observer, enabling version-targeted attacks. HTTPS hides it.
  • One-line fixes can close critical attack paths: The entire RCE chain described above is broken by removing a single ? character.

How Orbis AppSec Detected This

  • Source: The ref parameter passed into readUpdateManifest(ref) — an externally controllable string representing the manifest URL.
  • Sink: The fetch(value, { headers: { 'User-Agent': ... } }) call at server.js:567, reached only after the insufficiently strict regex check passes.
  • Missing control: No enforcement that the URL scheme is exclusively https:. The regex /^https?:\/\//i permitted plain HTTP URLs to reach the fetch call without any warning or error.
  • CWE: CWE-319 — Cleartext Transmission of Sensitive Information (also related to CWE-494: Download of Code Without Integrity Check).
  • Fix: The regex was tightened from /^https?:\/\//i to /^https:\/\//i, making the s in https mandatory and rejecting all non-HTTPS manifest URLs before any network request is made.

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

A single ? in a regular expression at line 567 of server.js was the difference between a secure update mechanism and a remote code execution vulnerability. The readUpdateManifest function accepted http:// URLs, meaning any attacker with a network position between the user and the update server could intercept the request, inject a malicious manifest, and deliver a trojanized installer — silently, on every affected machine.

The fix is a one-character change: removing the ? from https? so that only https:// URLs are accepted. Small changes in security-critical validation code carry outsized consequences in both directions — a single permissive character can open a critical attack path, and removing it can close it entirely.

When building or reviewing update mechanisms, treat the transport layer as a security boundary, not an implementation detail. Enforce HTTPS strictly, verify manifest signatures cryptographically, and audit every URL validation regex for accidental permissiveness.


Prevention and further reading

View the Security Fix

Check out the pull request that fixed this vulnerability

View PR #17

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.