Repository navigation
Conversation
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
- Build the password reset link only from the configured Base URL, never from Host or X-Forwarded-Host request headers - Without a Base URL, email the site-relative reset path instead of an absolute link derived from the request - Log SMTP failures instead of returning them to unauthenticated callers - Check email configuration before issuing a reset token - Add regression tests covering forged Host, X-Forwarded-Host, Forwarded and X-Original-Host headers
Notification subjects include subscription names, which any API key holder can set. A name containing CR/LF could inject headers or replace the body and Content-Type of emails sent to the administrator. - Build the message in one helper shared by the TLS and STARTTLS paths - Strip line breaks from every header value - RFC 2047 encode the subject and sender name, which also fixes non-ASCII subjects - Add tests for injected headers and body, non-ASCII subjects and configured addresses
|
Hi! I'm Maxim (@MaxKUlish1), the researcher who reported this issue. Just confirming that this is my GitHub account :) Thank you so much for confirming the vulnerability and preparing the fix so quickly! |
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.
Summary
Fixes password reset link poisoning in the unauthenticated forgot-password flow.
When no Base URL was configured,
ForgotPasswordbuilt the emailed reset link withbuildBaseURL(). That function falls back to the request'sX-Forwarded-Host,X-Forwarded-ProtoandHostheaders. Anyone who could reach SubTrackr could send a reset request with a forged host. The administrator would then receive a genuine reset email whose link delivered the reset token to the attacker's domain, which could lead to account takeover. The plainHostheader was exploitable too, so directly exposed installs were affected as well as proxied ones. Installs with a Base URL configured were not affected.Changes
/reset-password?token=…) to open on your own SubTrackr address, so reset keeps working. The example address in that email deliberately omits the token so mail clients cannot auto-link it to a foreign host.AuthHandlerdepends on a one-methodemailSenderinterface so the email can be captured in tests. The constructor is unchanged.Email header injection through notification subjects
While reviewing the open advisory GHSA-72v4-3xcj-2m8c, I found that notification email subjects include subscription names unsanitized. Any API key holder can set a name containing CR/LF, which could inject headers or replace the body and Content-Type of emails sent to the administrator. This is a phishing vector from the admin's own SubTrackr.
buildEmailMessagehelper is shared by the TLS and STARTTLS paths.Bccand body replacement, non-ASCII and long subjects, and configured addresses. Confirmed the injection test fails against the previous code.The advisory's stored XSS (calendar and category names) was already fixed in v0.6.10 (
4b05244,c787c4f) with Playwright coverage.Test Plan
Host,X-Forwarded-Host,ForwardedandX-Original-Hostheaders. They assert the email never contains the attacker host and that the emailed token still validates, with and without a Base URL.https://attacker.example/reset-password?token=…).go build ./...,go vet ./...andgo test -race ./...pass locally.Follow-ups (not in this release)
mainafter this release.Credit
The password reset link poisoning issue was reported by Maxim (@MaxKUlish1). Thank you for the careful report and responsible disclosure.