This repository was archived by the owner on May 29, 2026. It is now read-only.
fix(security): SSRF guard, DNS-rebinding mitigation, zip-bomb cap — H3, M2, M4, L1#347
Merged
Merged
Conversation
…3, M2, M4, L1 H3 (#326): FeedRefreshService::isPrivateIpGuarded() enforces HTTPS-only and rejects hostnames that resolve to private/reserved IP ranges (FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE), mirroring the existing CalendarWidgetService::validateUrl guard. Called from refreshFeed() before the HTTP request. M2 (#330): CalendarWidgetService::fetchIcsBody now calls validateUrl() immediately before the Guzzle get() to reduce the DNS-rebinding TOCTOU window. Full CURLOPT_RESOLVE pinning is noted as the next step. M4 (#332): ArchiveParser::collectEntries() checks statIndex('size') before getFromIndex() — entries > 25 MB are skipped; total HTML bytes are tracked and iteration halts at 100 MB (zip-bomb guard). L1 (#337): simplexml_load_string now passes LIBXML_NOENT in addition to LIBXML_NOCDATA | LIBXML_NONET, explicitly disabling entity substitution for defence-in-depth on older libxml builds.
This was referenced May 27, 2026
Closed
Closed
Closed
Closed
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
FeedRefreshService::isPrivateIpGuarded()enforces HTTPS-only and rejects hostnames that resolve to private/reserved IP ranges (FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE), mirroring the existingCalendarWidgetService::validateUrlguard. Called fromrefreshFeed()before any HTTP request.CalendarWidgetService::fetchIcsBodyre-callsvalidateUrl()immediately before the Guzzleget()to reduce the DNS-rebinding TOCTOU window. A note documents that fullCURLOPT_RESOLVEIP-pinning is the next step.ArchiveParser::collectEntries()checksstatIndex('size')beforegetFromIndex()— entries > 25 MB are skipped; total HTML bytes are tracked and iteration halts at 100 MB (zip-bomb guard). ConstantsMAX_ENTRY_BYTES/MAX_TOTAL_BYTESdocument the limits.simplexml_load_stringnow passesLIBXML_NOENTin addition toLIBXML_NOCDATA | LIBXML_NONET, explicitly disabling entity substitution for defence-in-depth on older libxml builds.Test plan
http://169.254.169.254/...rejected withSSRF guardfailure reasonhttp://127.0.0.1/...rejected🤖 Generated with Claude Code