Repository navigation
fix(dav): escape exception message in o:reason - #66139
Open
th-joerger wants to merge 1 commit into
Open
th-joerger wants to merge 1 commit into
th-joerger wants to merge 1 commit into
Conversation
Fixes nextcloud#66138 Signed-off-by: Thor <thor@joerger.dev>
th-joerger
requested review from
Altahrim,
leftybournes,
salmart-dev and
sorbaugh
and removed request for
a team
November 2, 2026 10:58
Author
|
/backport to stable35 |
This branch has not been deployed
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
Forbidden::serialize()andInvalidPath::serialize()passed the exception message as the value argument ofDOMDocument::createElementNS(), which does not escape&. With libxml2 2.9.x this logsunterminated entity referenceand sends an empty<o:reason>; with libxml2 2.13 the&is silently dropped.The element is now created empty and the message appended as a text node, as
apps/dav/lib/Exception/UidConflict.php#L76-L77already does. The existing serialization tests for both classes get a data provider with a message containing&.Verified end to end on 35.0.2 (PHP 8.5.12, libxml2 2.9.14):
<o:reason>carries the escaped message and no warning is logged. Details in #66138.Checklist
3. to review, feature component)stable32)AI (if applicable)