Skip to content

KC-1412: Fix email-config title lookup so shared-in records cannot redirect --send-email SMTP - #2296

Open
sshrushanth-ks wants to merge 2 commits into
record-add-send-email-fixfrom
record-add-send-email-fix-int
Open

KC-1412: Fix email-config title lookup so shared-in records cannot redirect --send-email SMTP#2296
sshrushanth-ks wants to merge 2 commits into
record-add-send-email-fixfrom
record-add-send-email-fix-int

Conversation

@sshrushanth-ks

Copy link
Copy Markdown
Contributor

Summary

Fixed record-add --send-email so email configuration is resolved only from records owned by the current account. Config lookup matched on title across the visible record cache, so a shared-in login titled like an email config (with __email_config__ and attacker SMTP settings) could send the onboarding mail and share URL through an attacker-controlled server.

Changes

  • email_commands.py: Updated find_email_config_record() to skip non-owned / shared-in matches and warn when ignoring them
  • record_edit.py: Fail early in record-add validation with Email configuration "..." not found when no owned config exists
  • discoveryrotation.py: Same clear not-found error on the pam action rotate email-config validation path
  • test_email_config_ownership.py: Added unit tests covering owned, shared-in, and missing owner-cache selection

Shared-in records titled like an email config could redirect
record-add --send-email SMTP delivery. Only owned configs are
eligible now, and missing configs fail with a clear error.
warning text, and cover record-add / pam rotate not-found paths.
@sshrushanth-ks
sshrushanth-ks marked this pull request as ready for review August 17, 2026 09:16
@sshrushanth-ks sshrushanth-ks self-assigned this Aug 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant