[bug] Invalid emoji ID in EmojiReact activity #1042
Labels
No labels
approved, awaiting change
broken setup
bug
cannot reproduce
configuration
documentation
duplicate
enhancement
extremely low priority
feature request
Fix it yourself
help wanted
invalid
mastodon_api
needs change/feedback
needs docs
needs tests
not a bug
not our bug
planned
pleroma_api
privacy
question
static_fe
triage
wontfix
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
AkkomaGang/akkoma#1042
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Your setup
No response
Extra details
No response
Version
3.17.0
PostgreSQL version
No response
What were you trying to do?
I receive emoji reaction activity where Emoji object has ID that is not properly encoded. The problem is similar to #820.
What did you expect to happen?
ID should be a valid URI (or not included at all, as was decided in #820)
What actually happened?
The name of emoji pack in
idandicon.urlis not encodedLogs
No response
Severity
I can manage
Have you searched for this issue?
Pleroma bug report: https://git.pleroma.social/pleroma/pleroma/-/issues/3389
Also, one of Pleroma devs asked me to include this in my report, because you might find it useful: https://git.pleroma.social/pleroma/pleroma/-/merge_requests/4364
We (should) never sent out Emoji objects with an
idfield. Are you sure you get those activities from up-to-date, unpatched Akkoma instances?ok, for whatever reason, emoji reaction builder in
web/activity_pub/builder.exdoes not use the same"Emoji"template as others, but a bespoke"Emoj"template which actually still contains bogus"id"fields…No, I am not 100% sure, I only verified it on Pleroma.
But the original report came from an Akkoma user: https://portal.gb0.dev/nodeinfo/2.1.json
Sorry for the late reply, this got closed before a fix landed in Pleroma and then I promptly forgot about it.
Using
URI.encodefrom Elixir's standard library is not sufficient to fix this. The docs aren't very clear about it and recently changed which made it even less clear, but URLs like:https://example.com/emoji/funny?pack/touching[grass].pngwill be left completely unencoded.URI.encodeonly encodes characters that are forbidden in the whole URI and not just the Path segment of it. UsingURI.char_unreserved?as aURI.encodepredicate isn't proper either as that is too greedy.I'm the one that told @silverpill to mention the MR from Pleroma which includes a
URIEncodingmodule that mostly fixes the Elixir module along with other bug fixes regarding URI encoding in Pleroma which also should still affect Akkoma afaik.Since the move to Forgejo, the old Gitlab MR can now be found at https://old.git.pleroma.social/pleroma/pleroma/-/merge_requests/4364 until April.
Pleroma MR that also fixed this emoji encoding issue here on old Gitlab: https://old.git.pleroma.social/pleroma/pleroma/-/merge_requests/4417
If you want an example emoji with a completely valid URL and filename that should also break in Akkoma: https://pl.borked.technology/emoji/weird emoji/touching?%20[草].png
Note: The URL should be used as-is even though Forgejo split it. In other words, it needs to be double-encoded since that is the actual name of the emoji pack and name of the file.
This is how it should look in the end: https://pl.borked.technology/emoji/weird%20emoji/touching%3F%2520%5B%E8%8D%89%5D.png