Skip to content

Sync email-only breaches to Remote Settings (mntor-5363) - #6818

Merged
GregHilstonMozilla merged 7 commits into
mainfrom
mntor-5363
Sep 9, 2026
Merged

GregHilstonMozilla merged 7 commits into
mainfrom
mntor-5363

Conversation

@GregHilstonMozilla

@GregHilstonMozilla GregHilstonMozilla commented Aug 27, 2026 •

Copy link
Copy Markdown
Collaborator

References:

Jira: MNTOR-5363

Description

We are going to be iterating on our openapi.yml contract, which is defined between the frontend and the backend for a breach integration. To achieve that with a thin and simple API, we'll be relying on Remote Settings data that is already being pushed. That dataset was missing records.

The sync previously only carried breaches that leaked passwords, so a breach that leaked a user's email but not their password would be invisible to Firefox and the privacy panel could never render it. This PR widens the periodic cron that pushes this data.

The rest of the PR is the types and doc strings that came with that change. HIBP spells data classes differently to us, and nothing in the codebase recorded that.

Changed since the first review: no IsSensitive

This PR originally also wrote an IsSensitive field onto each new record. Vincent and I agreed it is not needed: phase 2 only shows breach alerts for breaches the API returns as affecting the user, and the API does not return sensitive breaches, so Firefox never sees one to hide.

How to test

npx vitest run src/scripts/cronjobs/updateBreachesInRemoteSettings/ src/utils/hibp.test.ts

Checklist (Definition of Done)

  • Localization strings (if needed) have been added. Not applicable, no user-facing strings.
  • Commits in this PR are minimal and have descriptive commit messages.
  • I've added or updated the relevant sections in readme and/or code comments. Block comments added to BreachDataTypes, ResolutionRelevantBreachDataTypes and HibpLabelByDataType, which sit together and were easy to confuse.
  • I've added a unit test to test for potential regressions of this bug.
  • If this PR implements a feature flag or experimentation, I've checked that it still works with the flag both on, and with the flag off. Not applicable.
  • If this PR implements a feature flag or experimentation, the Ship Behind Feature Flag status in Jira has been set. Not applicable.
  • Product Owner accepted the User Story (demo of functionality completed) or waived the privilege.
  • All acceptance criteria are met. The remaining AC is a post-deploy check on the live collection.
  • Jira ticket has been updated (if needed) to match changes made during the development process. Summary, description and AC updated to drop IsSensitive.
  • Jira ticket has been updated (if needed) with suggestions for QA when this PR is deployed to stage.

@GregHilstonMozilla GregHilstonMozilla self-assigned this Aug 27, 2026
@GregHilstonMozilla
GregHilstonMozilla marked this pull request as ready for review August 27, 2026 20:00
PwnCount: breach.PwnCount,
AddedDate: breach.AddedDate,
DataClasses: breach.DataClasses,
// The panel hides these, the credential manager may not.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

this is where I'm adding the new property to the remote settings

@joeherm joeherm 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.

Code change LGTM- but left a question about the impact on older FF clients.

Comment thread src/app/functions/universal/breach.ts Outdated
Comment thread src/app/functions/universal/breach.ts
HIBP spells data classes differently to us, and the difference is not
mechanical: pins is PINs, ip-addresses is IP addresses, and General is
ours alone.

Nothing in the codebase recorded that, and I found it confusing. I was
concerned that the next person needing it would write the naive transform
and be silently wrong for two of thirteen. The Omit makes a missing or
misspelled key a compile error.

Also documents what distinguishes the three data type lookups, which sit
next to each other and are VERY easy to confuse.
The type said keyof HibpBreachDataTypes, which is the keys of our own
lookup, but HIBP sends its own Title Case labels. What originally tripped
me up is t only ever compiled because "Passwords" is both a key and a
real label, and that was the only value any code compared against.

`string`` is used , and not something narrower because 163 distinct
labels appear across real breaches and we name only 12 of them. So a
narrower type would reject valid data.

The narrow type already exists a layer down on `HibpLikeDbBreach`, once
formatDataClass has converted at ingestion.

Both fields now carry a comment, since they share a name and differ
only in vocabulary. Which would have originally helped me.
fxmonitor-breaches is how Firefox learns a site was breached, and it
held password breaches only, so an email-only breach was invisible and
the privacy panel could never render it.

IsSensitive ships in the same change because the cron only POSTs records
it has not seen and never updates them, so a record that lands without
the flag never gets it.

Sensitive breaches stay in the collection on purpose: as the panel must
hide them, while the credential manager may not.
Vincent and I agreed phase 2 does not need it. Phase 2 only shows breach
alerts for breaches the API returns as affecting a user, and the API does
not return sensitive breaches, so Firefox never sees one to hide
Vincent pointed out in review that this list is far from exhaustive. HIBP
coins a new data class whenever it meets a kind of data it has not seen,
and locales/en/data-classes.ftl already lists around 170 against our
thirteen

@Vinnl Vinnl 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.

Changes look good to me! As discussed, no more need for IsSensitive, considering that we're not even going to be telling the trust panel about sensitive breaches.

@GregHilstonMozilla
GregHilstonMozilla added this pull request to the merge queue Sep 9, 2026
Merged via the queue into main with commit dfb0248 Sep 9, 2026
19 checks passed
@GregHilstonMozilla
GregHilstonMozilla deleted the mntor-5363 branch September 9, 2026 14:40
@GregHilstonMozilla GregHilstonMozilla changed the title Mntor 5363 Sync email-only breaches to Remote Settings (mntor-5363) Oct 16, 2026
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