Repository navigation
Conversation
OskarEichler
force-pushed
the
codex/avoid-caching-string-header-names
branch
from
August 28, 2026 11:12
6a8fdef to
b25b1b2
Compare
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
iMacTia
approved these changes
Oct 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Prevent remote response header names from accumulating in Faraday's process-global normalization cache.
Faraday still caches symbol-to-header-name normalization, but string names now stay scoped to the individual
Headersobject. This closes a persistent-memory growth path when a remote peer returns fresh valid header names across repeated responses.Reproduction and verification
A bounded external reproduction creates 10,000 response-style
Headersobjects with unique names and releases them:v2.14.3: 10,000 global cache entries retained; 1,258,752 measured hash/key bytes on Ruby 4.0.6.git diff --checkpass.The byte measurement covers the cache hash and its keys/values after GC; it is not an RSS or throughput claim.
Limitations
HTTP adapters and servers typically bound headers per response, so exploitation requires repeated responses from an attacker-controlled or compromised endpoint. Only field names, not header values, were retained globally.
No test/spec files were added or changed under the originating audit's no-new-tests policy; the focused reproduction remained outside the repository.
Breaking-change notes
No intended public API change. String header names are no longer retained in the internal process-global
KeyMap; symbol normalization, including the specialETagmapping, remains cached.