Gmail send_email silently ignores from_address and sends from authenticated account
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.4k
- PR merge metrics
- PR metrics pending
Description
Summary
The Codex Desktop Gmail connector can silently ignore a caller-supplied from_address and send from the connector's authenticated account instead.
This is dangerous for workflows involving multiple Gmail identities because the tool reports success even though the actual RFC 5322 From header differs from the requested sender. It can cause unintended identity disclosure and external communication from the wrong account.
Environment
- Codex Desktop / ChatGPT desktop app: 26.825.51511 (build 7377)
- Platform: macOS
- Observed: 2026-08-31, America/New_York
- Component: Gmail connector
send_email
Steps to reproduce
- Authenticate the Gmail connector as account A.
- Call the Gmail
send_emailaction withfrom_addressset to a different account B. - Observe that the tool returns success and the message receives the Sent label.
- Read the sent message metadata or raw headers.
- Observe that the actual
Fromheader is account A, not the requested account B. - Check account B's Gmail Sent folder; the message is absent.
The two account addresses and the external recipient are intentionally omitted from this public report.
Actual behavior
- Connector profile reported account A.
- The send call explicitly requested account B in
from_address. - The connector reported a successful send.
- Sent-message metadata showed
From: ... <account A>. - Account B's Sent folder contained no corresponding message.
- A corrective message had to be sent manually from account B.
Expected behavior
The connector should fail closed when the requested from_address is not the authenticated account or a verified, usable Gmail alias.
Acceptable behavior would be either:
- Send from the requested address only when Gmail confirms it is an authorized send-as identity; or
- Reject the call before sending with a clear error that names the authenticated account and explains that the requested sender is unavailable.
It must never silently substitute the authenticated account while reporting success.
Suggested acceptance criteria
from_addressis validated against Gmail's configured send-as identities before transmission.- An unverified or unavailable sender causes a pre-send error and no message is created.
- The send result returns the actual sender identity used.
- The action exposes enough metadata for the caller to verify
From,To, thread ID, and attachments after sending. - Multi-account workflows fail closed when the intended account is ambiguous or inaccessible.
- Regression coverage includes authenticated account A plus requested account B.
Impact
This is more than a cosmetic mismatch. It can:
- disclose a personal address in professional or sensitive correspondence;
- misrepresent which identity authorized an external message;
- break audit trails and multi-account automations;
- cause duplicate corrective emails;
- undermine user trust in action confirmations.
Related issue
This is related to, but more severe than, #30418 (multiple named Gmail accounts). The specific defect here is silent sender substitution during a successful send.
Privacy
No email addresses, recipient information, message contents, OAuth data, message IDs, or raw logs are included. Redacted diagnostics can be provided privately if maintainers request them.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the Gmail connector's send_email action and trace how from_address is handled before transmission. Check the sender validation and send-result metadata against the listed acceptance criteria. Done means unauthorized senders fail before sending, authorized identities are used correctly, the actual sender is returned, and regression coverage includes accounts A and B.
Written by the indexing model from the issue text.
Assessment
- Domain
- api, authentication, security
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100