A PROPFIND on an exact cache entry crashes proxytrack#829
Open
xroche wants to merge 3 commits into
Open
Conversation
PT_Enumerate() reports a folder's default document as a zero-length name, and the WebDAV listing loop read thisUrl[thisUrlLen - 1] on it, four gigabytes past the string. One unauthenticated request took the whole listener down. Closes #828 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Xavier Roche <roche@httrack.com>
This was referenced Jul 27, 2026
The Windows job runs *_local-*.test and compares the skip list against an exact string, so an unpinned skip fails the leg with fail=0, which reads like a flake. Assert the href and the response count too: displayname alone comes from the href's trailing component, so it cannot see a wrong path above it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Xavier Roche <roche@httrack.com>
…default-doc Signed-off-by: Xavier Roche <roche@httrack.com> # Conflicts: # tests/Makefile.am
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.
proxytrack dies on one PROPFIND whose path names an exact cache entry.
PT_Enumerate()reports that entry's own default document under an empty name, and the WebDAV listing loop indexed it at[thisUrlLen - 1]with an unsigned length, so an empty name reads four gigabytes past the string. The crash takes the listener down rather than the connection, and nothing authenticates the request.The
isDefaultargument a few lines below already teststhisUrlLen == 0, so the empty name was expected there and only the is-a-directory test missed it.hts_lastchar()from #770 is the helper for exactly that. The HTML catalog listing carries the same line and is fixed alongside, though nothing reaches it today becauselistRequestis never set to 1.Closing #828 does not make PROPFIND safe. One frame below this read there is a write:
proxytrack_add_DAV_Item()reserves 1024 bytes andsprintf()s into it unbounded, andescapexml()expands&to&, so a path of escaped ampersands overruns even the grown capacity. That is #836, reachable on the same unauthenticated request and strictly worse than what this fixes. Kept out of this PR on purpose.The test replays the crash against a live proxytrack. It has to issue a second request to prove anything, since the failure mode is a dead process rather than a wrong answer. It also pins the
hrefand the response count:displaynameis derived from the href's trailing component, so on its own it cannot see a wrong path above it.Closes #828