Skip to content

Harden Email Translator input guards#1074

Open
Chenxizhe2025 wants to merge 1 commit into
Stellar-Mail:mainfrom
Chenxizhe2025:harden-email-translator-guards
Open

Harden Email Translator input guards#1074
Chenxizhe2025 wants to merge 1 commit into
Stellar-Mail:mainfrom
Chenxizhe2025:harden-email-translator-guards

Conversation

@Chenxizhe2025

Copy link
Copy Markdown

Summary

Closes #497.

Adds a folder-local security and performance hardening surface for the isolated Email Translator tool. The change stays entirely inside tools/v2/individual/email-translator/ and does not wire the tool into the main app.

Changes

  • Added services/email-translator-guards.mjs with request normalization, language checks, unsafe markup detection, secret-looking content blocking, bounded metadata handling, and translation workload estimation.
  • Added deterministic synthetic fixtures covering safe input, tracking-pixel warnings, active markup rejection, secret-looking content, and unsupported language rejection.
  • Added Node built-in tests for the local guard contract, large-body clipping, sanitizer behavior, and malformed metadata.
  • Added docs/SECURITY_AND_PERFORMANCE.md documenting threat assumptions, unsafe inputs, and performance limits.
  • Updated the tool README with the local validation command.

Validation

  • node --test tools/v2/individual/email-translator/tests/email-translator-guards.test.mjs - 4 passing
  • git diff --check

Boundary check

  • Only files under tools/v2/individual/email-translator/ changed.
  • No live network calls, secrets, production data, app shell, routing, inbox, wallet, Stellar, database, or shared design system changes.

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.

[V2][individual] Email Translator - Security and performance hardening

1 participant