Skip to content

Check mailgun signature - #171

Merged
Arsh-S merged 5 commits into
mainfrom
amber/check-mailgun-signature
Oct 30, 2026
Merged

Arsh-S merged 5 commits into
mainfrom
amber/check-mailgun-signature

Conversation

@ambers7

@ambers7 ambers7 commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

Checks that the Mailgun signature is from Mailgun and that the email was cryptographically signed by venmo.com, instead of someone changing the webhook POST to show being sent by Mailgun or changing the email to show Venmo.

  • verifies webhook POST was sent by Mailgun
  • verifies email was sent with Venmo using with DKIM (DomainKeys Identified Mail)
  • tests tampered signature, missing env var, missing/malformed message headers, and more

TODO:

  • add MAILGUN_WEBHOOK_SIGNING_KEY to env locally

How to test

Test with npx jest email.handlers.test.ts in backend
image

@vercel

vercel Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
curaise Ready Ready Preview Oct 28, 2026 7:59pm UTC

@CLAassistant

CLAassistant commented Oct 7, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@Arsh-S
Arsh-S requested a review from 8ddieHu0314 October 20, 2026 02:05
@8ddieHu0314

Copy link
Copy Markdown
Member

Hi Amber, thank you for the bug fix! A few changes: for the DKIM failure, it is better to return 406 instead of 401 so that it won't retry constantly at an interval. Also, please resolve the merge conflict

@Arsh-S Arsh-S left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks Amber, looks good! One gap: the DKIM check only looks at the first DKIM-Signature header, so a fake d=venmo.com header in front of a real signature from another domain would pass. Check all of them. I'll handle the rebase after. @ambers7

@coderabbitai

coderabbitai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: QUIET
  • Plan: Advanced
  • Run ID: cba28f89-1d10-4d2b-85ac-8a32be2a76e4

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

…ignature

# Conflicts:
#	backend/jest.config.js
#	backend/package.json
#	pnpm-lock.yaml
@Arsh-S
Arsh-S merged commit c53f521 into main Oct 30, 2026
5 checks passed
@Arsh-S
Arsh-S deleted the amber/check-mailgun-signature branch October 30, 2026 19:08

This branch was successfully deployed

1 active deployment
Preview — d2876917 Deployed Oct 28, 2026 by vercel[bot]
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.

4 participants