Urlencoded overflow still buffers one huge value in memory
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 68/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- csharp
- Ambito
- backend, performance
Direzione di ricerca
Start with MaxLib.WebServer/Post/UrlEncodedData.cs at lines 116-143 and 145-186. Trace how tokenBuffer grows, when MaximumCacheSize is checked, and how oversized data is written to a temp file. Done means a single oversized key=value token is streamed without creating the full decoded and re-encoded in-memory copies.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
An unauthenticated urlencoded body between 50 MB and 100 MB (the default MaxContentLength) that is a single key=value token is buffered whole. The tokenizer only flushes tokenBuffer on a literal &, and the size check against MaximumCacheSize happens only after ToArray, the decoded strings and the re-encoded UTF-8 bytes exist. That is several hundred MB of heap per request on the path meant to avoid in-memory buffering, so a few concurrent requests can exhaust memory.
Location: MaxLib.WebServer/Post/UrlEncodedData.cs:116-143, MaxLib.WebServer/Post/UrlEncodedData.cs:145-186
Fix: Check tokenBuffer.Length against MaximumCacheSize while accumulating and stream the rest of an oversized token straight to a temp file, skipping the string round-trip.
- Lingua principale
- C#
- Stelle
- 1
- Fork
- 3
- Merge medio
- 1g 9h
- PR unite (30g)
- 4
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Garados007/MaxLib.WebServer
-
Reason-phrase table has misspelled entries (`Unathorized`, `Switching Protcols`, `Multiple Choises`)Forse già presa @Jah-yee l’ha presa 20 giorni fa. Apertabug severity:low
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
documentation good first issue severity:low
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
-
bug severity:low
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
bug security severity:medium
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
-
bug severity:low
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
Tutte le issue di Garados007/MaxLib.WebServer
Issue simili
-
area-blazor NativeAOT Regression
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
dotnet/aspnetcore#70236 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug priority: P2
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
I maintainer di solito rispondono entro 1 giorno
-
bug evaluation required
Difficoltà 1/5 1-3 ore Idoneità per principianti 78/100
MaterialDesignInXAML/MaterialDesignInXamlToolkit#4118 ·
I maintainer di solito rispondono entro 1 giorno
-
documentation good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno