Enforce stricter boundary checks in MultipartReaderStream

Open Beginner friendly
#70,545 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
csharp
Domain
backend

Research direction

Read src/Http/WebUtilities/src/MultipartReaderStream.cs around line 322 and check both the sync and async boundary handling paths. Replace the broad whitespace trimming behavior with trimming limited to SPACE and HTAB, as the issue specifies. Done means other whitespace such as VT is preserved while allowed surrounding SPACE and HTAB are trimmed; run the relevant MultipartReaderStream tests.

Written by the indexing model from the issue text.

Description

area-networking

In the sync and async code paths we trim whitespace around the boundary which is allowed per RFC. However, we should only trim SPACE and HTAB per https://www.rfc-editor.org/rfc/rfc822.html#section-3.3.

string.Trim() trims more whitespace like VT characters
https://github.com/dotnet/aspnetcore/blob/034cdd3d1d487e4f692bb61a64b288c912372ecb/src/Http/WebUtilities/src/MultipartReaderStream.cs#L322

Dominant language
C#
Stars
38.5k
Forks
11.6k
Avg merge
3d 1h
Merged PRs (30d)
289

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from dotnet/aspnetcore

All issues in dotnet/aspnetcore

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.