mikel / mikel/mail

Multibyte tidy_bytes accepts malformed UTF-8 sequences and miscomputes boundaries

Open
#1,680 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Ruby
Stars
3.7k
Forks
934
PR merge metrics
No merged PRs in 30d

Description

## Problem

The multibyte byte-tidying path accepts invalid or truncated UTF-8 sequences and advances using byte patterns without validating continuation bytes and codepoint bounds. Malformed input can be preserved or consume neighboring bytes incorrectly.

Prepared commit `d6578be887c4487342d20461237af2aede98cd22` validates sequence lengths, continuation bytes, overlong/surrogate/out-of-range codepoints and preserves valid boundary behavior.

External exhaustive boundary models pass on both Rubies. The unchanged 1,837-example suite, package and Action Mailer integration also pass.

CONTRIBUTING requires regression specs, so this report does not open a source-only PR or modify tests.

Contributor guide

Open the contributing guide

Research direction

Start by locating the multibyte byte-tidying path and reviewing prepared commit d6578be887c4487342d20461237af2aede98cd22. Run the existing 1,837-example suite plus the package and Action Mailer integration checks; done means malformed or truncated UTF-8 is rejected safely while valid boundary behavior remains unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.