firebase / firebase/extensions

fix(firestore-send-email): anchor the SMTP_CONNECTION_URI validation regex (kit and legacy)

Open
#3,067 0 comments 0 reactions 0 assignees Claimed by @CorieW View on GitHub
kits
Dominant language
TypeScript
Stars
979
Forks
433
Avg merge
1d 13h
Merged PRs (30d)
125

Description

The `SMTP_CONNECTION_URI` validationRegex accepts trailing garbage after a valid prefix: its first alternative has no `$` anchor, so e.g. `smtp://host:25 trailing junk` passes. Probe-verified; `...)$|^$` rejects the garbage forms. The bug is inherited: the legacy `firestore-send-email/extension.yaml` ships the identical unanchored regex (only the legacy test file carried an anchored copy that never shipped). Fix both the kit (`kits/firestore-send-email/src/config.ts:171`) and the legacy extension.yaml.

PR #3057 added a characterization test that pins the current unanchored acceptance - it is written to flip when this fix lands, so update it deliberately. Found by review on #3057 (IzaakGough). Ledger: #2974.

Contributor guide

Open the contributing guide

Research direction

Start at kits/firestore-send-email/src/config.ts:171 and compare its SMTP_CONNECTION_URI validationRegex with firestore-send-email/extension.yaml. Review the characterization test added by PR #3057, then update it deliberately so trailing garbage is rejected in both kit and legacy configurations. Done means the relevant tests pass and both shipped regexes reject the malformed forms.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.