[Devin] fix: change newsletter subscribe endpoint from GET to POST#10
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
[Devin] fix: change newsletter subscribe endpoint from GET to POST#10devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
The newsletter subscribe endpoint used GET with email in query params, which violates REST semantics for mutations and exposes PII (email addresses) in server logs, browser history, and URL bars. Changed to POST with email in the request body. Kept GET for backward compatibility but removed the PII logging. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
10 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The newsletter subscribe endpoint uses
GETwith the email address in a query parameter (/api/newsletter/subscribe?email=...). This violates REST semantics (mutations should use POST), exposes PII (email addresses) in server logs, browser history, and URL bars, and the original code also logged the email to console (console.log(\Subscribed: ${email}`)`).Where
File:
api/mock-server.jsLines: 57–66 (newsletter subscribe endpoint)
How I found it
// BUG: This endpoint is GET but the frontend should POST,// BUG: email in query param, not request body,// BUG: PII in server logs.Evidence
Original code:
Fix
POSTendpoint that reads email fromreq.bodyinstead of query paramsconsole.logthat was leaking PII to server logsGETendpoint for backward compatibility but removed the PII loggingConfidence
High — Using GET for mutations with PII in query params is a well-known anti-pattern with clear security implications.
Summary
Changes newsletter subscribe from GET (email in URL) to POST (email in body) to follow REST semantics and prevent PII exposure.
Review & Testing Checklist for Human
POST /api/newsletter/subscribewith{"email": "test@example.com"}in body — should return 200GET /api/newsletter/subscribe?email=test@example.comstill works for backward compatNotes
Found via static analysis — multiple code comments documented this as an intentional bug. The fix addresses REST semantics, PII exposure, and server logging concerns.
Link to Devin session: https://app.devin.ai/sessions/3b3d59c7eee04cea9069529fd6fff39d
Requested by: @scoobycoder