GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — HttpUtil.isEncodingSafeStartLineToken incorrectly rejects valid URIs containing 'J' or 'M' · Issue #16089 · netty/netty

HttpUtil.isEncodingSafeStartLineToken incorrectly rejects valid URIs containing 'J' or 'M' #16089

New issue
Copy link
New issue
Copy link
Closed as not planned
Closed as not planned
HttpUtil.isEncodingSafeStartLineToken incorrectly rejects valid URIs containing 'J' or 'M'#16089
Copy link

Description

@SmartHaven
SmartHaven
opened on Dec 27, 2025
Issue body actions

Bug

isEncodingSafeStartLineToken in Netty 4.2.8 rejects valid URIs like /cgi-bin/eventManager.cgi

Cause

The bit-shift logic wraps around for characters >= 64:

long ch = 1L << token.charAt(i);  // 1L << 77 == 1L << 13

Since M = ASCII 77 and 77 % 64 = 13, it collides with \r in the mask.

Affected characters

Char ASCII Collides with
J 74 \n (10)
M 77 \r (13)
` 96 space (32)

Reproduce

HttpUtil.isEncodingSafeStartLineToken("/eventManager.cgi"); // returns false (bug)
HttpUtil.isEncodingSafeStartLineToken("/eventmanager.cgi"); // returns true (ok)

Fix suggestion

Check if character is actually in the illegal set before applying bitmask:

if (c < 64 && (1L << c & ILLEGAL_MASK) != 0) return false;

Activity

  1. SmartHaven commented on Dec 27, 2025

    @SmartHaven
    SmartHaven
    on Dec 27, 2025
    Author
    More actions

    Closing - this was already fixed in 4.2.9 via PR #16030

  2. SmartHaven
    closed this as not plannedon Dec 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.