Skip to content

Avoid undefined array key sharing request - #59778

Merged
ChristophWurst merged 1 commit into
masterfrom
bug/noid/avoid-undefined-array-key-sharing-request
Apr 22, 2026
Merged

Avoid undefined array key sharing request#59778
ChristophWurst merged 1 commit into
masterfrom
bug/noid/avoid-undefined-array-key-sharing-request

Conversation

@kesselb

@kesselbkesselb commented Apr 21, 2026

Copy link
Copy Markdown
Contributor

Summary

Avoid an undefined array key warning when sending a malformed share request.

I will send a follow up to integrate with config lexicon.

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

@kesselbkesselb self-assigned this Apr 21, 2026
@kesselbkesselb added the bug label Apr 21, 2026
@kesselbkesselb added the 3. to review Waiting for reviews label Apr 21, 2026
@kesselb
kesselb requested review from ArtificialOwl, Copilot, icewind1991, leftybournes and salmart-dev and removed request for a teamApril 21, 2026 09:29
@kesselb

Copy link
Copy Markdown
ContributorAuthor

/backport to stable33

@kesselb

Copy link
Copy Markdown
ContributorAuthor

/backport to stable32

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR hardens DAV share request handling to avoid undefined array key warnings on malformed XML, and adds per-user rate limiting for share requests.

Changes:

  • Add RateLimiting service and enforce it in the DAV Sharing Plugin POST handler.
  • Validate share requests (must include 1–10 set/remove elements) and reject invalid payloads with BadRequest.
  • Update and expand unit tests for sharing and rate limiting; remove redundant CardDAV sharing plugin test.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.

Show a summary per file
FileDescription
apps/dav/lib/DAV/Sharing/Plugin.phpAdds rate-limit enforcement and request validation for share POSTs.
apps/dav/lib/DAV/Sharing/Xml/ShareRequest.phpHandles null XML element lists and introduces a constant for the share element QName.
apps/dav/lib/DAV/Security/RateLimiting.phpNew rate limiting helper for share requests.
apps/dav/lib/Server.phpInjects RateLimiting into the sharing plugin for calendars/addressbooks.
apps/dav/tests/unit/DAV/Sharing/PluginTest.phpUpdates plugin construction and adds tests for invalid share requests.
apps/dav/tests/unit/DAV/Security/RateLimitingTest.phpNew unit tests for rate limiting behavior.
apps/dav/tests/unit/CardDAV/Sharing/PluginTest.phpRemoves an older/redundant test.
apps/dav/composer/composer/autoload_static.phpAdds classmap entry for the new rate limiting class.
apps/dav/composer/composer/autoload_classmap.phpAdds classmap entry for the new rate limiting class.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment threadapps/dav/lib/DAV/Sharing/Xml/ShareRequest.php
Comment threadapps/dav/lib/Server.php
Comment threadapps/dav/lib/Server.php
Comment threadapps/dav/tests/unit/DAV/Security/RateLimitingTest.php
Comment threadapps/dav/composer/composer/autoload_static.php
AI-assisted: OpenCode (gpt-5.4)
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
@kesselb
kesselbforce-pushed the bug/noid/avoid-undefined-array-key-sharing-request branch from f766153 to 055bd5cCompareApril 21, 2026 13:32
@ChristophWurst
ChristophWurst merged commit e1049a8 into masterApr 22, 2026
189 of 194 checks passed
@ChristophWurst
ChristophWurst deleted the bug/noid/avoid-undefined-array-key-sharing-request branch April 22, 2026 10:32
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to reviewWaiting for reviewsbug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@kesselb@CarlSchwan@SebastianKrupinski@ChristophWurst