Skip to content

fix: resolve user data leakage in BCC mass email templates (#5444) [skip ci] - #5444

Merged
tidusjar merged 1 commit into
Ombi-app:developfrom
mike10010100:bugfix-5239-mass-email-bcc-leak
Jul 29, 2026
Merged

fix: resolve user data leakage in BCC mass email templates (#5444) [skip ci]#5444
tidusjar merged 1 commit into
Ombi-app:developfrom
mike10010100:bugfix-5239-mass-email-bcc-leak

Conversation

@mike10010100

@mike10010100 mike10010100 commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

📝 Description

When sending mass emails via BCC with templates containing personalized placeholders (like {Alias}, {UserName}), the template was previously resolved once using the first user in the recipient list (validUsers.FirstOrDefault()). Because BCC sends a single copy of the email body to all recipients, everyone received a message addressed to that first user, exposing their real username/alias.

This PR fixes the data leakage by instantiating a generic dummy OmbiUser (UserName = "User", Alias = "User") to resolve placeholders to a generic "User" value when in BCC mode.

🔗 Related Issues

Fixes #5239

🧪 Testing

Updated the unit test in MassEmailSenderTests.cs (SendMassEmail_Bcc) to include {Alias} and {UserName} in the test message body and verified that they correctly resolve to "User".

  • Unit tests pass
  • Integration tests pass
  • Manual testing completed
  • No breaking changes

📸 Screenshots (if applicable)

N/A (Backend change)

📋 Checklist

  • My code follows the project's coding standards
  • I have mentioned if this is a vibe coded PR (Yes, this was fully vibe coded!)
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

🎯 Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Performance improvement
  • Code refactoring

📚 Additional Notes

This PR was vibe coded with love by Antigravity AI assistant pair-programming with the repository owner.

Summary by CodeRabbit

  • Bug Fixes
    • Improved mass email sending so template placeholders are resolved consistently when sending BCC messages.
    • Ensured the generated email content uses the expected recipient name values for bulk emails, leading to more accurate personalised output.
  • Tests
    • Updated mass email sender tests to reflect the corrected placeholder-based message content and expected provider payload.

Copilot AI review requested due to automatic review settings July 9, 2026 14:53
@reposhark

reposhark Bot commented Jul 9, 2026

Copy link
Copy Markdown

🦈 RepoShark Health Check

Metric Value
Health Score 🟡 63/100 (no change)
PR Size XS

View full analysis → · Powered by RepoShark

@tidusjar

tidusjar commented Jul 9, 2026

Copy link
Copy Markdown
Member

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 698187f8-f316-4f8e-a12d-5cfd555cd62c

📥 Commits

Reviewing files that changed from the base of the PR and between b41b868 and 9e68699.

📒 Files selected for processing (2)
  • src/Ombi.Core.Tests/Senders/MassEmailSenderTests.cs
  • src/Ombi.Core/Senders/MassEmailSender.cs
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/Ombi.Core/Senders/MassEmailSender.cs

📝 Walkthrough

Walkthrough

MassEmailSender’s BCC path now resolves template placeholders with a placeholder user instead of the first valid recipient. The BCC test was updated to use placeholder variables in the email body and to assert the resolved message value.

Changes

MassEmail BCC placeholder fix

Layer / File(s) Summary
BCC curly resolver placeholder
src/Ombi.Core/Senders/MassEmailSender.cs
SendBccMails now initialises NotificationMessageCurlys with a placeholder OmbiUser whose UserName and Alias are both "User", while BCC email addresses still come from the validated users list.
Test coverage for placeholder resolution
src/Ombi.Core.Tests/Senders/MassEmailSenderTests.cs
SendMassEmail_Bcc now uses a body template containing {Alias} and {UserName}, and its provider assertion checks for the resolved message "Test User User" instead of comparing against model.Body.

Estimated code review effort: 2 (Simple) | ~10 minutes

Poem

A rabbit sent a BCC with care,
No first-user shadows lingered იქ?
Placeholders hopped to values true,
“Test User User” now shines through.
Hoppy mail, and tidy too. 🐇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title follows Conventional Commits with a valid fix prefix, lowercase description, and matches the mass email BCC leak change.
Description check ✅ Passed The description includes all required sections and clearly explains the fix, related issue, testing, checklist, type of change, and notes.
Linked Issues check ✅ Passed The code and test changes address #5239 by replacing real recipient data with a generic user when resolving BCC template placeholders.
Out of Scope Changes check ✅ Passed The changes stay focused on BCC template rendering and the corresponding unit test, with no obvious unrelated modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes a privacy bug in MassEmailSender where BCC mass emails with personalized template placeholders could leak the first recipient’s username/alias to all BCC recipients by resolving the template against the first valid user.

Changes:

  • Resolve BCC template placeholders using a generic dummy OmbiUser (UserName/Alias set to "User") instead of the first recipient.
  • Update the BCC unit test to include {Alias} and {UserName} in the body and assert they resolve to "User".

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/Ombi.Core/Senders/MassEmailSender.cs Avoids user data leakage in BCC mode by resolving template placeholders against a generic dummy user.
src/Ombi.Core.Tests/Senders/MassEmailSenderTests.cs Extends BCC test coverage to validate {Alias} / {UserName} resolve to "User" in BCC emails.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/Ombi.Core/Senders/MassEmailSender.cs
@mike10010100
mike10010100 force-pushed the bugfix-5239-mass-email-bcc-leak branch from b41b868 to 9e68699 Compare July 9, 2026 14:57
@sonarqubecloud

sonarqubecloud Bot commented Jul 9, 2026

Copy link
Copy Markdown

@tidusjar tidusjar changed the title fix: resolve user data leakage in BCC mass email templates fix: resolve user data leakage in BCC mass email templates (#5444) [skip ci] Jul 29, 2026
@tidusjar
tidusjar merged commit a5cfb02 into Ombi-app:develop Jul 29, 2026
21 checks passed
@github-actions

Copy link
Copy Markdown

🎉 Thank you for your contribution!

Your changes have been successfully merged and will be included in the next release.

What you contributed:

Thank you for helping make Ombi better! 🙏

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

All users variables in MassEmail with BCC default to the first valid user

3 participants