Skip to content

Validate JIDs - #2257

Merged
jubalh merged 7 commits into
masterfrom
rosterw
Nov 16, 2026
Merged

jubalh merged 7 commits into
masterfrom
rosterw

Conversation

@jubalh

@jubalh jubalh commented Nov 13, 2026

Copy link
Copy Markdown
Member

Fixes: #2250

We didn't check the return value of jid_create.
If muc_rooms() contains an invalid room JID and roster.rooms.by=service,
jidp->domainpart is dereferenced.

Signed-off-by: Michael Vetter <jubalh@iodoru.org>
muc_join() did not validate that the room argument is a valid bare room
JID. Malformed or invalid room strings were inserted into the rooms
hash table, propagating to muc_rooms() and causing crashes downstream.

Signed-off-by: Michael Vetter <jubalh@iodoru.org>
We need to validate the JIDs before parsing/storing bookmarks.

Signed-off-by: Michael Vetter <jubalh@iodoru.org>
Ensure barejid is not NULL, valid, and does not contain a resource part.

Signed-off-by: Michael Vetter <jubalh@iodoru.org>
Add support for `/join room@conference.example.com/mynick`.
Extract the bare JID as the room and use the resource part as the nickname
if no nick option is provided otherwise.

Signed-off-by: Michael Vetter <jubalh@iodoru.org>
When joining a room where the service is appended from account preferences
(/join room or /join without args) resulting room JID was not validated.

If the service was invalid, we rejected it silently with no feedback to
the user.

Signed-off-by: Michael Vetter <jubalh@iodoru.org>
In case a user adds a contact via `user@example.com/phone`
We just drop the resource part from now on.
Earlier this didn't work at all if a resource was provided.

We do the same in `/sub` already.

Signed-off-by: Michael Vetter <jubalh@iodoru.org>
@jubalh jubalh added this to the next milestone Nov 13, 2026
@jubalh jubalh self-assigned this Nov 13, 2026
@jubalh

jubalh commented Nov 13, 2026

Copy link
Copy Markdown
Member Author

@trustqq please give it a try.

@jubalh
jubalh merged commit b327e8e into master Nov 16, 2026
12 checks passed
@jubalh
jubalh deleted the rosterw branch November 16, 2026 08:07
@trustqq

trustqq commented Nov 17, 2026

Copy link
Copy Markdown

It passed! Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rosterwin: missing jid_create() NULL check causes SIGSEGV on invalid room JID

2 participants