Skip to content

fix(gdpr): send export email in POST body, not GET query string#1235

Open
euniceamoni wants to merge 2 commits into
solutions-plug:mainfrom
euniceamoni:fix/gdpr-data-export-sends-the-user-s-personal-email
Open

fix(gdpr): send export email in POST body, not GET query string#1235
euniceamoni wants to merge 2 commits into
solutions-plug:mainfrom
euniceamoni:fix/gdpr-data-export-sends-the-user-s-personal-email

Conversation

@euniceamoni

@euniceamoni euniceamoni commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #1156

The GDPR data export endpoint was sending the user's email address as a URL query parameter (GET /api/v1/newsletter/gdpr/export?email=...), exposing PII to server access logs, browser history, and intermediary proxy logs.

Changes

Frontend (client.ts)

  • newsletterGdprExport changed from GET + params: { email } to POST + body: { email }

Backend (handlers.rs, main.rs)

  • Added NewsletterExportBody struct for JSON body deserialization
  • Handler extractor changed from Query<NewsletterExportQuery> to Json<NewsletterExportBody>
  • #[utoipa::path] updated from get to post with request_body
  • Route registration changed from get() to post()

Tests (client.test.ts)

  • Updated it.each entry for newsletterGdprExport to expect POST
  • Added describe('GDPR export (#1156)') with a test asserting:
    • The email does not appear in the URL
    • The email is present in the JSON request body

Testing

cd frontend && npm test -- client --watchAll=false

All 50 tests pass, including the new GDPR export test.

Build

next build compiles successfully with zero warnings. closes #1156

PII (email address) was being sent as a URL query parameter on
GET /api/v1/newsletter/gdpr/export, exposing it to server access
logs, browser history, and proxy logs.

Changes:
- frontend: newsletterGdprExport now uses POST with body: { email }
  instead of GET with params: { email } (client.ts)
- backend: added NewsletterExportBody struct, changed handler extractor
  from Query to Json, updated utoipa path attribute to post,
  updated route registration from get() to post() (handlers.rs, main.rs)
- tests: updated it.each entry to expect POST; added new test in
  'GDPR export (solutions-plug#1156)' describe block asserting email is in the
  request body and absent from the URL

Fixes solutions-plug#1156
@drips-wave

drips-wave Bot commented Jul 27, 2026

Copy link
Copy Markdown

@euniceamoni Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Update openapi.yaml /api/v1/newsletter/gdpr/export from GET with
query parameter to POST with requestBody (EmailRequest schema), matching
the handler change in handlers.rs.

Update SPEC_ROUTES in openapi_contract_test.rs from GET to POST to
keep the contract test in sync with the spec and runtime router.
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.

[Bug] GDPR data export sends the user's personal email via a logged GET query string

1 participant