convos-chat / convos-chat/convos

[SASL] Fail to generate SASL certificate from private key when user's email contain a '+'

Open
#922 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Go
Stars
1.2k
Forks
93
PR merge metrics
No merged PRs in 30d

Description

Describe the bug

When a user email address contain a + character (and maybe also other type of characters?), the creation of the user private key work, but not the creation of the certificate.

It fail with the error message:

Failed to generate cert: openssl req -x509 -new -newkey rsa:4096 -sha256 -nodes -days 3650 -out /data/contact+test@lithio.fr/irc-lithio/irc-lithio.cert -keyout /data/contact+test@lithio.fr/irc-lithio/irc-lithio.key -subj /C=NO/O=Convos/CN=contact+test/emailAddress=contact+test@lithio.fr FAIL 256 /  at /app/lib/Convos/Util.pm line 78.

To Reproduce

Steps to reproduce the behavior:

  1. Create an invite link for a user with a + in email address
  2. Login with this account
  3. Just after login, see error message in Convos logs
  4. SASL using certificate don't work

Expected behavior

SASL certificate creation should work for users with a + (or any other RFC 3696 (section 3) compliant characters) in email address.

Environment

  • OS: Archlinux (using Docker)
  • Browser: Firefox (136.0.2)
  • Version: 8.07
  • IRC server software: UnrealIRCd (6.1.9.1) with Atheme (7.2.11) and SASL enabled

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at /app/lib/Convos/Util.pm line 78 and reproduce the failure using the OpenSSL command shown with an email containing '+'. Confirm the completed behavior by creating the user's certificate successfully and verifying that SASL certificate authentication works for the reproduced account.

Written by the indexing model from the issue text.

Assessment

Tech stack
perl
Domain
authentication, security
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.