Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plain text organization invite URL is broken #5097

Closed
z3ntu opened this issue Oct 17, 2024 · 2 comments · Fixed by #5100
Closed

Plain text organization invite URL is broken #5097

z3ntu opened this issue Oct 17, 2024 · 2 comments · Fixed by #5100
Labels
bug Something isn't working

Comments

@z3ntu
Copy link

z3ntu commented Oct 17, 2024

Vaultwarden Support String

Admin mode is not enabled, should not be relevant

Vaultwarden Build Version

1.32.1

Deployment method

OS Package (apt, yum/dnf, pacman, apk, nix, ...)

Custom deployment method

No response

Reverse Proxy

nginx 1.22.1

Host/Server Operating System

Linux

Operating System Version

No response

Clients

Web Vault

Client Version

No response

Steps To Reproduce

  1. Invite a user to an organization
  2. Check the link received via email for the invited user ("You have been invited to join the test orga organization. ")

Expected Result

The URL should be properly formed in both HTML and plain text variant, like https://vaultwarden.example.org/#/accept-organization/?email=test%40example.org&organizationName=test+orga&organizationId=<>&organizationUserId=<>&token=<>

Actual Result

The URL is only correctly formed in the HTML variant, in the plain text variant it reads

https://vaultwarden.example.org/#/accept-organization/?email&#x3D;test%40example.org&amp;organizationName&#x3D;test+orga&amp;organizationId&#x3D;<>&amp;organizationUserId&#x3D;<>&amp;token&#x3D;<>

And when you click this link you get "Unable to accept invitation. Ask an organization admin to send a new invitation."

Logs

No response

Screenshots or Videos

No response

Additional Context

No response

@z3ntu z3ntu added the bug Something isn't working label Oct 17, 2024
BlackDex added a commit to BlackDex/vaultwarden that referenced this issue Oct 18, 2024
Ever since we changed to pass the full url as a template value handlebars now html-encodes this.
This causes issues with the plain/text mails, but it also could potentially cause issues with the text/html templates.

This PR encloses the template values inside triple braces `{{{ }}}` which prevents html-encoding.
Since the URL is generated via the `url` crate the values are percent-encoded anyway.

Fixes dani-garcia#5097

Signed-off-by: BlackDex <[email protected]>
@BlackDex
Copy link
Collaborator

BlackDex commented Oct 18, 2024

Indeed, and resolved via #5100

dani-garcia pushed a commit that referenced this issue Oct 18, 2024
Ever since we changed to pass the full url as a template value handlebars now html-encodes this.
This causes issues with the plain/text mails, but it also could potentially cause issues with the text/html templates.

This PR encloses the template values inside triple braces `{{{ }}}` which prevents html-encoding.
Since the URL is generated via the `url` crate the values are percent-encoded anyway.

Fixes #5097

Signed-off-by: BlackDex <[email protected]>
@z3ntu
Copy link
Author

z3ntu commented Oct 18, 2024

Thanks for the quick fix, appreciate it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants