Skip to content
Access control Audit finding Intermediate

Deleting an unverified email channel can remove another user s sendgrid contact

The notification channel deletion endpoint authorised only the caller's own local channel row, then ran a SendGrid contact cleanup keyed purely on the email address. Because pending email channels for the same address could exist across users, an attacker could plant a pending channel for a victim's email and later delete it to remove the victim's SendGrid broadcast contact.

johnyfwesh Follow

Originally disclosed on Immunefi

  • Disclosed after under an hour

92966 w a low deleting an unverified email channel can remove another user s sendgrid contact

Submitted on Sep 13th 2026 at 14:25:20 UTC by @Johnyfwesh for Audit Competition | ENS

  • Report ID: #92966
  • Report Type: Websites & Apps
  • Report severity: Low
  • Target: https://github.com/immunefi-team/audit-comp-ens/tree/audit-comp-ready/workers
  • Impacts:
    • Changing non-sensitive details of other users (including modifying browser local storage) without already-connected wallet interaction and with up to one click of user interaction, such as: Enabling/disabling notifications
    • Changing sensitive details of other users (including modifying browser local storage) without already-connected wallet interaction and with up to one click of user interaction, such as: Email
    • Taking state-modifying authenticated actions (with or without blockchain state interaction) on behalf of other users without any interaction by that user, such as: Changing registration information Notification/settings changes

Description

Finding Description and Impact

DELETE /notifications/channels/:id authorizes only the local userChannels row: it loads the channel with id + user_id and, if that row exists, deletes it. For email channels it then performs SendGrid broadcast cleanup keyed solely by channel.target. That cleanup calls searchContact(env, channel.target) and, when a contact exists, deleteContact(env, contact.id). Neither call requires the deleted channel to be verified, and neither checks whether another user still holds a verified (or pending) binding for the same email.

POST /notifications/channels/email does not close that gap. It rejects an email only when another user already has a verified channel for it. Pending rows for the same address are allowed across users because user_channels uniqueness is (user_id, channel, target), not (channel, target). An attacker can therefore create a pending channel for a victim email before the victim verifies, wait until the victim’s verification enrolls that email in the SendGrid broadcast list via addContactToList, and then delete the attacker-owned pending row. Ownership of the local pending record is treated as authority over the global contact.

This is a first-party authorization failure on a state-modifying notification action. the proven impact is unauthorized removal of the victim’s SendGrid broadcast contact, which disrupts SendGrid-based broadcast notifications without any victim interaction at deletion time.

Affected code

TypeScript
.delete('/', ...requireAuth, injectDb, async (c) => {
  const userId = c.var.user_id
  const channelId = c.req.param('id')

  const channel = await c.var.db.query.userChannels.findFirst({
    where: and(
      eq(TABLE.userChannels.id, channelId),
      eq(TABLE.userChannels.user_id, userId),
    ),
  })

  if (!channel) {
    return c.json({ error: 'Channel not found' }, 404)
  }

  await c.var.db
    .delete(TABLE.userChannels)
    .where(eq(TABLE.userChannels.id, channelId))

  // broadcast list cleanup via waitUntil
  if (
    channel.channel === 'email' &&
    channel.target &&
    c.env.SENDGRID_BROADCAST_LIST_ID
  ) {
    const env = {
      SENDGRID_API_KEY: c.env.SENDGRID_API_KEY,
      SENDGRID_BROADCAST_LIST_ID: c.env.SENDGRID_BROADCAST_LIST_ID,
    }
    c.executionCtx.waitUntil(
      Promise.resolve(
        searchContact(env, channel.target).andThen((contact) =>
          contact ? deleteContact(env, contact.id) : okAsync(undefined),
        ),
      ),
TypeScript
      const existingChannel = await c.var.db.query.userChannels.findFirst({
        where: and(
          eq(TABLE.userChannels.user_id, userId),
          eq(TABLE.userChannels.channel, 'email'),
          eq(TABLE.userChannels.target, email),
        ),
      })

      if (existingChannel) {
        if (existingChannel.status === 'verified') {
          return c.json(
            { error: 'Email already verified for this account' },
            400,
          )
        }
        // If pending, we can resend verification
      }

      // Check if email is linked to another user
      const otherUserChannel = await c.var.db.query.userChannels.findFirst({
        where: and(
          eq(TABLE.userChannels.channel, 'email'),
          eq(TABLE.userChannels.target, email),
          eq(TABLE.userChannels.status, 'verified'),
        ),
      })

      if (otherUserChannel && otherUserChannel.user_id !== userId) {
        return c.json(
          { error: 'This email address is already linked to another account' },
          400,
        )
      }
TypeScript
export const userChannels = pgTable(
  'user_channels',
  {
    id: uuid('id').primaryKey().default(randomUUIDv7),
    user_id: uuid('user_id')
      .notNull()
      .references(() => users.id, {
        onDelete: 'cascade',
      }),
    channel: text('channel').$type<ChannelType>().notNull(),
    target: text('target'),
    // ...
    status: text('status').$type<UserChannelStatus>().notNull(),
  },
  (table) => [
    unique('user_channel_unique').on(
      table.user_id,
      table.channel,
      table.target,
    ),
  ],
)
TypeScript
      // broadcast list sync via waitUntil
      if (c.env.SENDGRID_BROADCAST_LIST_ID && verification.channel?.target) {
        c.executionCtx.waitUntil(
          Promise.resolve(
            addContactToList(
              {
                SENDGRID_API_KEY: c.env.SENDGRID_API_KEY,
                SENDGRID_BROADCAST_LIST_ID: c.env.SENDGRID_BROADCAST_LIST_ID,
              },
              verification.channel.target,
              verification.user_id,
            ),
          ),
TypeScript
export const searchContact = ResultFn(async function* (
  env: SendGridEnv,
  email: string,
) {
  const url = new URL(`${BASE_URL}/v3/marketing/contacts/search/emails`)

  const response = yield* fromPromise(
    fetch(url, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
        Authorization: `Bearer ${env.SENDGRID_API_KEY}`,
      },
      body: JSON.stringify({
        emails: [email.toLowerCase()],
      }),
    }),
    createIntoError('SENDGRID_CONTACTS_ERROR'),
  )
  // ...
    const contact = parsed.result[email.toLowerCase()]?.contact
TypeScript
export const deleteContact = ResultFn(async function* (
  env: SendGridEnv,
  contactId: string,
) {
  const url = new URL(`${BASE_URL}/v3/marketing/contacts`)
  url.searchParams.set('ids', contactId)

  const response = yield* fromPromise(
    fetch(url, {
      method: 'DELETE',
      headers: {
        Authorization: `Bearer ${env.SENDGRID_API_KEY}`,
      },
    }),
    createIntoError('SENDGRID_CONTACTS_ERROR'),
  )
  • deleteContact removes the marketing contact entirely from SendGrid, not merely from a list. Combined with email-only search, deleting an attacker pending channel unenrolls the victim from broadcast delivery.

Impact

Unauthorized broadcast-contact deletion for another user

  • An ordinary wallet holder with their own JWT and a known victim email can remove that email from the SendGrid broadcast list after the victim has verified. No stolen credentials, privileged role, or victim click is required at deletion time ($id.ts#L62-L109).
  • This is a state-modifying notification action taken on behalf of another user: the victim’s SendGrid enrollment is destroyed while their local verified channel remains.

Pending email bindings are not exclusive

  • POST /email allows multiple pending rows for one address (email.ts#L58-L72), and user_channel_unique is per-user (notifications.ts#L73-L78). The attacker can plant the pending row before the victim verifies and keep it indefinitely.

Alignment with Immunefi and ENS program rules

This report is in scope for the ENS Immunefi Audit Competition (Websites and Applications) under the program scope page and the Immunefi Vulnerability Severity Classification System v2.3 (Websites and Apps). The demonstrated behavior matches the following published rules.

In-scope asset. The program lists workers/ specifically workers/api-worker (SIWE, JWT, notifications, SendGrid/Telegram webhooks) as an in-scope GitHub tree. The authorization failure and SendGrid cleanup live in that worker (DELETE /notifications/channels/:id, POST /notifications/channels/email, searchContact / deleteContact). A fault in this tree, or reachable through it, is in scope.

Program impact: state modifying authenticated notification actions. The program’s in-scope impacts include:

Taking state-modifying authenticated actions (with or without chain interaction) on behalf of other users without any interaction by that user (registration info, notification/settings changes, …)

This report matches that rule. The attacker uses their own authenticated JWT. DELETE /notifications/channels/:id is a state modifying notification channel action. Cleanup then deletes the victim’s SendGrid broadcast contact the victim’s notification enrollment without any action by the victim at deletion time. The program expressly names notification/settings changes as an example of this impact.

Immunefi v2.3: changing another user’s notification details. Immunefi’s Websites and Apps classification includes:

Changing non-sensitive details of other users (including modifying browser local storage) without already-connected wallet interaction and with up to one click, e.g. enabling/disabling notifications.

This report matches that rule. The attacker does not need the victim’s connected wallet. A single authenticated DELETE disables the victim’s SendGrid-based broadcast delivery while the victim’s local channel still shows as verified. That is enabling/disabling another user’s notifications.

First-party worker logic; eligible adversary. The program treats bugs in how the in-scope apps and workers build and apply notification state as in scope. The attacker is an ordinary SIWE-authenticated wallet holder, privileged governance, or local-network adversary, all of which the program lists as excluded. The finding is present in the frozen in-window code on workers/api-worker and is a first-party authorization/cleanup defect, not a finding against an unmodified third-party service.

Demonstrated, single root cause. The program and Immunefi require a concrete, demonstrated impact. The report traces UI/API intent through the worker handlers to searchContact / deleteContact, and the included worker test drives the real email-create, email-verify, and channel-delete handlers to show the victim’s broadcast contact is removed. One logical root cause is reported: local pending-row ownership is treated as authority over the global contact for that email.

Recommended mitigation steps

  1. Do not treat local row ownership as authority over a global email contact:
    • Skip SendGrid cleanup unless the deleted channel is verified, and
    • Before searchContact / deleteContact, confirm no other userChannels row (especially status = 'verified') still uses that target.
  2. Prefer list removal over contact destruction when a contact might be shared:
    • Use removeContactFromList only after the exclusivity check above, or
    • Key marketing contacts by user_id (already sent as a custom field) and refuse to delete a contact whose user_id is not the caller.
  3. Close the pending-duplicate setup path:
    • Reject POST /email when any other user already has a pending or verified channel for the same normalized email, and/or
    • Add a unique constraint on (channel, target) for email bindings so two users cannot share one address.

Proof of Concept

PoC Test (runs in workers/api-worker/test/unverified-email-channel-sendgrid-contact-deletion.test.ts) demonstrating cross-user SendGrid contact deletion

The PoC drives the real email-create, email-verify, and channel-delete handlers and the production SendGrid client in contacts.ts. fetch is stubbed only at the HTTP boundary and replies with the same Marketing Contacts shapes those functions parse. Assertions are on the resulting PUT / POST …/search/emails / DELETE /v3/marketing/contacts?ids= calls, not on a stand-in deleteContact mock.

Exploit sequence

  1. Attacker authenticates with their own JWT and POST /notifications/channels/email for mixed-case [email protected]. The handler normalizes the target to [email protected] and inserts a pending userChannels row the attacker owns.
  2. Victim creates their own pending channel for the same email. Both rows exist because uniqueness is (user_id, channel, target) and the cross-user check only looks for status = 'verified'.
  3. Victim completes POST /email/verify. Their row becomes verified and real addContactToList issues PUT /v3/marketing/contacts with custom_fields.user_id = victim.
  4. Attacker DELETE /notifications/channels/:attackerChannelId while their row is still pending. Authorization succeeds on the local row; real searchContact / deleteContact then issue POST /v3/marketing/contacts/search/emails for [email protected] and DELETE /v3/marketing/contacts?ids=<victim contact id> — not the safer list-removal URL. The victim’s verified database row remains.

Control cases (same file)

  • After the victim is already verified, a late attacker POST /email is 400 (This email address is already linked to another account). The decoy must be planted before the victim verifies.
  • If the attacker deletes the pending row before the victim verifies, the handler still searches SendGrid (missing verified guard) but deleteContact is not issued because no contact exists yet. The victim can still verify and enroll afterward.
  • When the victim deletes their own verified channel, DELETE /v3/marketing/contacts?ids= is the intended cleanup path. The bug is that the same global-by-email cleanup also runs for an attacker-owned pending row.

Relevant Code Flow Diagram

MERMAID
sequenceDiagram
    participant Attacker
    participant API as API worker
    participant DB as userChannels
    participant Victim
    participant SG as SendGrid contacts

    Attacker->>API: POST /channels/email ([email protected]) + attacker JWT
    API->>DB: insert pending row (attacker, [email protected])
    Note over API: Cross-user check only rejects verified bindings
    Victim->>API: POST /channels/email ([email protected]) + victim JWT
    API->>DB: insert pending row (victim, email)
    Victim->>API: POST /email/verify (victim token)
    API->>DB: status = verified
    API->>SG: PUT /v3/marketing/contacts (email + victim user_id)
    Note over SG: Global contact exists for the shared email
    Attacker->>API: DELETE /channels/:attackerChannelId + attacker JWT
    API->>DB: findFirst(id, attacker user_id) then delete local row
    Note over API: No verified-status or other-user check
    API->>SG: POST /contacts/search/emails for [email protected]
    SG-->>API: victim contact id
    API->>SG: DELETE /v3/marketing/contacts?ids=victimContactId
    Note over Victim: Local verified channel still present<br/>Broadcast contact is gone

Test file workers/api-worker/test/unverified-email-channel-sendgrid-contact-deletion.test.ts

TypeScript
import { sign } from 'hono/jwt'
import { okAsync } from 'neverthrow'
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
import { makeMockEnv } from '#test-utils/env.js'

/**
 * In-memory `user_channels` / `channel_verifications` used by the route
 * handlers. Hoisted so the `getDatabase` mock factory can close over it.
 *
 * The walker only implements the Drizzle `eq` / `and` / `gt` trees these
 * handlers emit. It is not a general SQL engine (no `users` FK, no `ne`).
 */
const harness = vi.hoisted(() => {
  type ChannelRow = {
    id: string
    user_id: string
    channel: string
    target: string | null
    data: unknown
    status: string
    status_reason: string | null
    verified_at: Date | null
    last_sent_at: Date | null
    last_bounce_at: Date | null
    last_verification_sent_at: Date | null
    verification_attempts: number
  }

  type VerificationRow = {
    id: string
    user_id: string
    channel_id: string
    channel: string
    target: string | null
    purpose: string
    token: string
    created_at: Date
    expires_at: Date
    consumed_at: Date | null
    attempts: number
  }

  type SendGridContact = {
    id: string
    email: string
    listIds: string[]
    userId?: string
  }

  type RecordedSendGridRequest = {
    method: string
    pathname: string
    searchParams: Record<string, string>
    body: unknown
    authorization: string | null
  }

  return {
    channels: [] as ChannelRow[],
    verifications: [] as VerificationRow[],
    contacts: new Map<string, SendGridContact>(),
    sendgridRequests: [] as RecordedSendGridRequest[],
    getDatabase: vi.fn(),
  }
})

vi.mock('#core/database/index.js', async (importOriginal) => {
  const actual =
    await importOriginal<typeof import('#core/database/index.js')>()
  return {
    ...actual,
    getDatabase: harness.getDatabase,
  }
})

vi.mock('#services/email/verification.js', () => ({
  sendVerificationEmail: vi.fn(() => okAsync({ statusCode: 202 })),
}))

vi.mock('#services/email/welcome.js', () => ({
  sendWelcomeEmail: vi.fn(() => okAsync({ statusCode: 202 })),
}))

vi.mock('#utils/logger.js', () => ({
  logger: {
    info: vi.fn(),
    error: vi.fn(),
    warn: vi.fn(),
    debug: vi.fn(),
    trace: vi.fn(),
  },
}))

import app from '#app/index.js'
import { TABLE } from '#core/database/index.js'

const VICTIM_EMAIL_INPUT = '[email protected]'
const VICTIM_EMAIL = '[email protected]'
const ATTACKER_USER_ID = '11111111-1111-4111-8111-111111111111'
const VICTIM_USER_ID = '22222222-2222-4222-8222-222222222222'
const ATTACKER_ADDRESS = '0xa11ce00000000000000000000000000000000000'
const VICTIM_ADDRESS = '0xb0b0000000000000000000000000000000000000'
const BROADCAST_LIST_ID = 'ens-broadcast-list'
const JWT_SECRET = 'poc-jwt-secret'
const SENDGRID_API_KEY = 'SG.poc'
const SENDGRID_ORIGIN = 'https://api.sendgrid.com'

type Predicate = {
  column: string
  op: string
  value: unknown
}

const UNSET = Symbol('unset')

const columnName = (node: unknown): string | undefined => {
  if (!node || typeof node !== 'object') {
    return undefined
  }
  const candidate = node as {
    name?: unknown
    table?: unknown
    dataType?: unknown
    columnType?: unknown
  }
  if (
    typeof candidate.name === 'string' &&
    (candidate.table || candidate.dataType || candidate.columnType)
  ) {
    return candidate.name
  }
  return undefined
}

const operatorString = (node: unknown): string | undefined => {
  if (typeof node === 'string') {
    return node
  }
  if (!node || typeof node !== 'object') {
    return undefined
  }
  const candidate = node as { value?: unknown; queryChunks?: unknown[] }
  if (typeof candidate.value === 'string') {
    return candidate.value
  }
  if (Array.isArray(candidate.value)) {
    return candidate.value.map(String).join('')
  }
  if (Array.isArray(candidate.queryChunks)) {
    return candidate.queryChunks
      .map((chunk) => {
        if (typeof chunk === 'string') {
          return chunk
        }
        if (chunk && typeof chunk === 'object' && 'value' in chunk) {
          const value = (chunk as { value: unknown }).value
          return Array.isArray(value) ? value.join('') : String(value ?? '')
        }
        return ''
      })
      .join('')
  }
  return undefined
}

const paramValue = (node: unknown): unknown => {
  if (!node || typeof node !== 'object') {
    return UNSET
  }
  const candidate = node as {
    value?: unknown
    queryChunks?: unknown[]
    table?: unknown
  }
  if ('value' in candidate && !candidate.queryChunks && !candidate.table) {
    return candidate.value
  }
  return UNSET
}

/**
 * Walk a Drizzle SQL tree (`eq` / `and` / `gt`) and recover column comparisons
 * so the in-memory store can honor the same predicates the handlers pass in.
 */
const extractPredicates = (node: unknown): Predicate[] => {
  const predicates: Predicate[] = []

  const visit = (current: unknown) => {
    if (!current || typeof current !== 'object') {
      return
    }
    const chunks = (current as { queryChunks?: unknown[] }).queryChunks
    if (!Array.isArray(chunks)) {
      return
    }

    for (let index = 0; index < chunks.length; index += 1) {
      const name = columnName(chunks[index])
      if (name) {
        const op = operatorString(chunks[index + 1])
        const value = paramValue(chunks[index + 2])
        if (op && value !== UNSET) {
          predicates.push({
            column: name,
            op: op.replace(/\s+/g, ''),
            value,
          })
          index += 2
          continue
        }
      }
      visit(chunks[index])
    }
  }

  visit(node)
  return predicates
}

const compare = (actual: unknown, op: string, expected: unknown) => {
  if (op === '>' || op === '>=' || op === '<' || op === '<=') {
    const left =
      actual instanceof Date
        ? actual.getTime()
        : typeof actual === 'number'
          ? actual
          : Number.NaN
    const right =
      expected instanceof Date
        ? expected.getTime()
        : typeof expected === 'number'
          ? expected
          : Number.NaN
    if (op === '>') return left > right
    if (op === '>=') return left >= right
    if (op === '<') return left < right
    return left <= right
  }
  return actual === expected
}

const rowMatches = (
  row: Record<string, unknown>,
  where: unknown,
  label: string,
) => {
  if (!where) {
    return true
  }
  const predicates = extractPredicates(where)
  if (predicates.length === 0) {
    throw new Error(
      `PoC store could not parse Drizzle where-clause for ${label}`,
    )
  }
  return predicates.every((predicate) =>
    compare(row[predicate.column], predicate.op, predicate.value),
  )
}

const isUserChannels = (table: unknown) => table === TABLE.userChannels
const isVerifications = (table: unknown) => table === TABLE.channelVerifications

const createMemoryDb = () => {
  const insertChannel = (
    values: Record<string, unknown>,
    conflictSet?: Record<string, unknown>,
  ) => {
    const existing = harness.channels.find(
      (channel) =>
        channel.user_id === values.user_id &&
        channel.channel === values.channel &&
        channel.target === values.target,
    )
    if (existing) {
      if (conflictSet) {
        Object.assign(existing, conflictSet)
      }
      return [existing]
    }

    const row = {
      id: crypto.randomUUID(),
      data: null,
      status_reason: null,
      verified_at: null,
      last_sent_at: null,
      last_bounce_at: null,
      last_verification_sent_at: null,
      verification_attempts: 0,
      ...values,
    } as (typeof harness.channels)[number]
    harness.channels.push(row)
    return [row]
  }

  const insertVerification = (values: Record<string, unknown>) => {
    const row = {
      id: crypto.randomUUID(),
      target: null,
      created_at: new Date(),
      consumed_at: null,
      attempts: 0,
      ...values,
    } as (typeof harness.verifications)[number]
    harness.verifications.push(row)
    return [row]
  }

  return {
    query: {
      userChannels: {
        findFirst: async ({ where }: { where?: unknown } = {}) =>
          harness.channels.find((channel) =>
            rowMatches(channel, where, 'userChannels.findFirst'),
          ),
      },
      channelVerifications: {
        findFirst: async ({
          where,
          with: relations,
        }: {
          where?: unknown
          with?: { channel?: boolean }
        } = {}) => {
          const verification = harness.verifications.find((row) =>
            rowMatches(row, where, 'channelVerifications.findFirst'),
          )
          if (!verification) {
            return undefined
          }
          if (relations?.channel) {
            return {
              ...verification,
              channel:
                harness.channels.find(
                  (channel) => channel.id === verification.channel_id,
                ) ?? null,
            }
          }
          return verification
        },
      },
    },
    insert: (table: unknown) => {
      let values: Record<string, unknown> = {}
      let conflictSet: Record<string, unknown> | undefined
      const chain = {
        values: (value: Record<string, unknown>) => {
          values = value
          return chain
        },
        onConflictDoUpdate: (opts: { set: Record<string, unknown> }) => {
          conflictSet = opts.set
          return chain
        },
        returning: async () => {
          if (isUserChannels(table)) {
            return insertChannel(values, conflictSet)
          }
          if (isVerifications(table)) {
            return insertVerification(values)
          }
          throw new Error('PoC store insert on unexpected table')
        },
      }
      return chain
    },
    update: (table: unknown) => ({
      set: (values: Record<string, unknown>) => ({
        where: async (where: unknown) => {
          if (isUserChannels(table)) {
            for (const channel of harness.channels) {
              if (rowMatches(channel, where, 'userChannels.update')) {
                Object.assign(channel, values)
              }
            }
            return
          }
          throw new Error('PoC store update on unexpected table')
        },
      }),
    }),
    delete: (table: unknown) => ({
      where: async (where: unknown) => {
        if (isUserChannels(table)) {
          const remaining = harness.channels.filter(
            (channel) => !rowMatches(channel, where, 'userChannels.delete'),
          )
          const removedIds = harness.channels
            .filter((channel) =>
              rowMatches(channel, where, 'userChannels.delete'),
            )
            .map((channel) => channel.id)
          harness.channels.splice(0, harness.channels.length, ...remaining)
          // Mirror ON DELETE CASCADE from channel_verifications.channel_id.
          const keptVerifications = harness.verifications.filter(
            (verification) => !removedIds.includes(verification.channel_id),
          )
          harness.verifications.splice(
            0,
            harness.verifications.length,
            ...keptVerifications,
          )
          return
        }
        if (isVerifications(table)) {
          const remaining = harness.verifications.filter(
            (verification) =>
              !rowMatches(verification, where, 'channelVerifications.delete'),
          )
          harness.verifications.splice(
    

The original report as published on Immunefi, by Johnyfwesh. Images and videos are our own copies; raw HTML is shown as text. View it on Immunefi.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the delete handler treats ownership of a local, unverified channel row as authority over a global SendGrid contact identified only by email address, with no verified-status or other-user check.

Impact

An ordinary authenticated user could remove another user's SendGrid broadcast contact without any victim interaction at deletion time, disrupting broadcast notifications while the victim's local channel still shows as verified.

What the attacker needed

An authenticated account; attacker plants pending row before victim verifies; victim verifies the same email address

The fix

The report recommends skipping SendGrid cleanup unless the deleted channel is verified, checking that no other user still holds a verified binding for the address, and rejecting or uniquely constraining duplicate pending email bindings.

How it was found

  1. Attacker authenticates with their own token and creates a pending email channel for the victim's address.
  2. Victim creates their own pending channel for the same address, which is allowed because uniqueness is per user.
  3. Victim completes verification, which adds their contact to the SendGrid broadcast list.
  4. Attacker deletes their own still-pending channel, which triggers a global contact search and deletion by email.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

When you add an email address to receive notifications, the site stores a record for your account and also adds that address to a mailing list held by an outside email service. The delete function only checked that the record belonged to whoever was calling it, not that the address was confirmed or that nobody else was using it. So someone could register the same address first, wait for the real owner to confirm it, then delete their own unconfirmed record and wipe the real owner's mailing-list entry.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

More by johnyfwesh

View all

8 more disclosed reports, best first.

More from ENS

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.