CVE-2026-29086: Hono Cookie Attribute Injection Vulnerability

hono Updated 04 Mar 2026

Summary

04/03/2026
Yes i
Moderate
5.4

CVE-2026-29086: Hono Vulnerable to Cookie Attribute Injection via Unsanitized domain and path in setCookie(). Affects hono versions < 4.12.4. Fixed in 4.12.4. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

Hono is a lightweight web framework designed for building web applications and APIs. It provides utilities for handling HTTP requests and responses, including the ability to set cookies through the setCookie() function. This function is essential for managing user sessions and maintaining state in web applications. However, it has a critical vulnerability that allows for cookie attribute injection, potentially compromising application security.

Vulnerability Detail

The vulnerability arises from the setCookie() utility not properly validating input for the domain and path options. Specifically, it fails to reject unsafe characters such as semicolons, carriage returns, and newline characters. This oversight can lead to the injection of additional cookie attributes, which may alter cookie behavior and security settings. Attackers could exploit this flaw by manipulating cookie attributes, affecting cookie scoping and security attributes based on browser behavior. The issue is limited to attribute-level manipulation within a single Set-Cookie header, but it poses a moderate risk to applications that improperly handle user-controlled input.

How To Fix

Latest published version: 4.13.13 as of 23 Oct 2026

npm install hono@4.13.13

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

4.12.4

This is the first release that contains the fix.

npm install hono@4.12.4

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, ensure that any user-controlled input passed to the domain and path options of the setCookie() function is sanitized to remove semicolons, carriage returns, and newline characters. For example, you can implement a simple validation function:

function sanitizeInput(input) {
    return input.replace(/[;\r\n]/g, '');
}

const domain = sanitizeInput(userInputDomain);
const path = sanitizeInput(userInputPath);
setCookie('name', 'value', { domain, path });

Conclusion

The CVE-2026-29086 vulnerability in the Hono framework poses a moderate risk due to improper validation in the setCookie() function. It is crucial to update to version 4.12.4 or later to mitigate this risk. Additionally, implementing input sanitization can serve as a temporary measure until the update is applied.

See every vulnerability recorded for hono →

Share this vulnerability

FAQ

CVE-2026-29086 is a vulnerability in the Hono framework that allows for cookie attribute injection due to improper validation of input in the setCookie() function.

If your application uses the Hono framework and allows user-controlled input in cookie settings, an attacker could manipulate cookie attributes, potentially compromising security.

All versions of Hono prior to 4.12.4 are affected by this vulnerability.

You can use Vulert, a tool that monitors open-source vulnerabilities, to check if your application is affected by this vulnerability. Visit Vulert Scanner for more information.

If an immediate update is not possible, implement input sanitization for the domain and path options in the setCookie() function as a temporary workaround.

Related vulnerabilities

Recent vulnerabilities recorded for hono.

How To Fix

Latest published version: 4.13.13 as of 23 Oct 2026

npm install hono@4.13.13

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

4.12.4

This is the first release that contains the fix.

npm install hono@4.12.4

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback