Skip to content

Accept folded Newsgroups header values - #211

Merged
enteriaza merged 1 commit into
masterfrom
166-bug-protocol-folded-newsgroups-values-are-rejected
Oct 19, 2026
Merged

enteriaza merged 1 commit into
masterfrom
166-bug-protocol-folded-newsgroups-values-are-rejected

Conversation

@enteriaza

Copy link
Copy Markdown
Collaborator

Summary

Closes #166

Fix Newsgroups header validation to accept valid folded values in accordance with RFC 5536 §3.1.4, while rejecting whitespace that splits a newsgroup name.

Changes

  • Unfold valid CRLF continuations before validating Newsgroups values.
  • Accept folding whitespace around commas, including continuations using spaces or tabs.
  • Reject spaces and tabs inside group names with InvalidNewsgroups.
  • Continue rejecting bare CR and LF, malformed continuations, empty group tokens, and invalid group-name characters.
  • Preserve the original article bytes and leave the shared header unfolder and other header validators unchanged.
  • Update ArticleRecord.md to document the validation behavior.
  • Add regression tests for legal folds, malformed whitespace, and overview serialization of folded Newsgroups values.

Validation

  • NntpArticleParserTests — 103 passed
  • Newsgroups parser and OverviewArticleV1CodecTests — 27 passed
  • VectorNNTPD.Common.Tests — 928 passed
  • VectorNNTPD.BackFillerService.Tests — 1,266 passed
  • Release x64 solution build — 0 warnings, 0 errors
  • dotnet format VectorNNTPD.slnx --verify-no-changes — passed
  • Local CodeQL analysis — no findings in the changed files

Compatibility

Valid folded Newsgroups values are now accepted, with group names preserved correctly in overview data. Whitespace inside a group name is rejected rather than silently accepted.

Note: CodeQL results are from local analysis and do not replace GitHub code scanning. Leading and trailing whitespace acceptance remains broader than the strict RFC 5536 grammar.

Unfold valid CRLF continuations before validating Newsgroups,
allow whitespace around group separators, and reject whitespace
inside group names. Add parser and overview regression coverage.
@enteriaza enteriaza self-assigned this Oct 19, 2026
@enteriaza enteriaza added the bug Something isn't working label Oct 19, 2026
@enteriaza
enteriaza merged commit 0d3634f into master Oct 19, 2026
7 checks passed
@enteriaza
enteriaza deleted the 166-bug-protocol-folded-newsgroups-values-are-rejected branch October 19, 2026 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug: Protocol] Folded Newsgroups values are rejected

1 participant