Repository navigation
fix: generate the public calendar link server-side in sendmail [2.0] - #1389
Open
oc-tmueller wants to merge 3 commits into
Open
oc-tmueller wants to merge 3 commits into
oc-tmueller wants to merge 3 commits into
Conversation
The public "send mail" endpoint now takes only the public sharing token and builds the link itself via linkToRouteAbsolute(), instead of accepting a caller-supplied URL. The calendar and user name are HTML-escaped in the mail body. Backport of #1363. (cherry picked from commit db65a9a) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Thomas Müller <323649642+oc-tmueller@users.noreply.github.com>
A token the public route cannot hold (e.g. one containing "/") made the router throw InvalidParameterException while building the link, so the request ended in a 500. Validate the token with the same allowlist the public calendar pages use and answer 400 instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Thomas Müller <323649642+oc-tmueller@users.noreply.github.com>
Core 10 runs vsprintf() on every translated string, also when no parameters are given. The backported template translated the publication line without parameters, so vsprintf() failed on the two %s and core fell back to the English source text. Pass placeholder tokens as parameters and replace them with the escaped values afterwards. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Thomas Müller <323649642+oc-tmueller@users.noreply.github.com>
phil-davis
approved these changes
Oct 30, 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.
Backport of #1363 to
release-2.0(ownCloud 10.16, PHP 7.4), plus the follow-up from #1388.POST /v1/public/sendmailnow takes only the public sharing token, and builds the link itself vialinkToRouteAbsolute()instead of accepting a caller-supplied URL. The calendar and user name are HTML-escaped in the mail body. Apart from CHANGELOG, this is a straight cherry-pick./) is answered with 400 instead of a 500 from the router. fix: reject a malformed token in the public sendmail endpoint #1388 is still open on master; if it changes there, this commit will follow.vsprintf()on every translation, also when no parameters are given. The template from fix: harden calendar public sendmail against phishing via server-side link generation (OC10-123) #1363 translated the publication line without parameters, so on core 10 it always fell back to English. It now passes placeholder tokens and replaces them with the escaped values afterwards. Core 11 returns the translation unchanged in that case, so master is not affected.Tested:
/p/<token>link and the translated, escaped publication line. A caller-suppliedurlis ignored, and a missing or malformed token gets 400.The CHANGELOG link is added in the release commit.
🤖 Generated with Claude Code