Skip to content
Open dashboard (opens in a new tab)

Scans

Leaked credential check

Usernames and passwords for your application end up in breach data when your users reuse a password somewhere else, or when malware on a user’s machine steals what the browser has saved. A list of leaked accounts tells you who might be exposed. It does not tell you which of those passwords still work.

The leaked credential check answers that. During a scan, NightVision looks up leaked credentials that match your application, signs in with each one through your own recorded login, and reports the ones that get in. A confirmed credential means someone else can sign in to your application today.

The check is off by default. You turn it on for each scan.

  1. NightVision searches breach data for credentials leaked for your application’s host.
  2. For each candidate, it replays your recorded login with the leaked username and password in place of your own.
  3. It loads a page that only a signed-in user can reach, and applies the rules you set to decide whether the login worked.
  4. A credential that signs in becomes a finding.

The check also runs controls so that a result means what it says. It signs in with a made-up username and password that cannot be real, and it loads your validation page with no session at all. If either of those passes your rules, the rules are not telling signed-in from signed-out, and NightVision reports that instead of a false alarm.

  • A recorded login. The check replays a login flow, so the scan must use a recorded login. Header and cookie authentications have no login flow to replay.
  • A login with one username step and one password step. NightVision swaps the leaked pair into those two fields. A recording that types a third value, such as an organization code or a PIN, cannot be replayed.
  • No MFA on the authentication. A leaked username and password cannot complete a login that asks for a one-time code, and NightVision never replays your recorded code for another account.
  • NightVision Cloud. The check does not run on scans through the CLI helper, so the application must be reachable from the internet.
  • A web or API application, and a full scan. A login check does not run it.

When the check cannot be used, the switch in New scan is disabled and the reason is shown beside it.

The New scan setup with a recorded login selected. The Leaked credential check switch is disabled, and the text under it reads: This authentication has MFA configured, so a replayed credential could not complete its login.
The check is disabled, with the reason, when the authentication has MFA.
  1. Select New scan and choose the application.
  2. Under Authentication, choose a recorded login.
  3. Leave Where it runs on NightVision Cloud.
  4. In the Leaked credentials row, turn on Leaked credential check.
  5. Fill in How to tell a replayed login succeeded (next section).
  6. Select Start scan.

Turning the check on is your consent to test real people’s leaked credentials against your login. That is why it is a choice you make per scan and is never switched on for you.

You can run the check alone. In Advanced > Checks, turn off ZAP and Nuclei templates and leave the leaked credential check on. The scan signs in, runs the check and finishes.

Tell NightVision what a successful login looks like

Section titled “Tell NightVision what a successful login looks like”

After each replayed login, the check loads one URL with that session and applies your rules. A good rule set passes for any signed-in user and fails for everyone else.

The Leaked credentials row in New scan with the check turned on. The Post-login validation URL holds an account page address. Response must contain has the entry Sign out, Response must not contain has the entry Invalid email or password, and Response status is set to Must be 200.
The leaked credential check turned on, with its validation rules.
Field What to enter
Post-login validation URL Required. A page that only a signed-in user can reach, such as an account or settings page. It must start with http:// or https://.
Response must contain Optional. Text that only a signed-in page shows, such as “Sign out”. Not case-sensitive. Type an entry and select Add.
Response must not contain Optional. Text that a signed-in page never shows, such as “Forgot password”. Not case-sensitive.
Response status Must be 200 (default), Must be one of these status codes, or Ignore the status.

Each list takes up to 8 entries of up to 512 characters. Ignore the status needs at least one “must contain” or “must not contain” entry, so the check still has something to judge by.

Three rules of thumb:

  • Do not use text that belongs to one account. Your own name on the page proves that you are signed in. Every other account shows a different name, so a real hit would fail the rule. Use text every signed-in user sees.
  • Pick a page that sends signed-out visitors away. If the URL returns 200 with the same content to anyone, the rules cannot tell the difference.
  • Add a “must not contain” entry for your login error. Applications that answer a failed login with a 200 page are common, and this catches them.

NightVision fills the fields in for you when it can. It starts from the last scan of this application and authentication that ran the check, or from the authentication’s last login check. It never copies Response must contain from an earlier run, for the first reason above. Check what was filled in before you start.

Save the validation rules once on the application, and scans use them without asking again.

  1. Open the application and choose More settings > Leaked credentials.
  2. Select Edit, fill in the same four fields, and save.
The Leaked credentials panel for the application customer-portal. It lists a validation URL, two phrases the response must contain, one phrase it must not contain, and a response status rule, with Clear and Edit buttons.
The validation settings saved on an application.

Or save from New scan: fill in the fields and tick Save to this application before you start the scan.

Once settings are saved:

  • New scan shows them as a read-only summary when you turn the check on. To use other rules once, select Use a different config for this scan.
  • Scheduled scans and rescans follow the saved settings, and pick up your edits from their next run.
  • The scan’s Details > Scan parameters shows where its rules came from: “From the application’s settings”.

If you Clear the saved settings, scans that follow them skip the leaked credential check until a validation URL is saved again. A scan whose only work was the check does not run.

Saving and clearing need a role that can change the application.

Open the scan and select Checks. The leaked credential check has its own row, with the type Leaked Credential.

The Checks tab of a scan showing the Leaked Credential Confirmed row, of type Leaked Credential, rated Critical, with the result Found a problem and a link reading Raised 1 finding.
The leaked credential check on a scan's Checks tab.

Application history in that row sums up what the check has found for this application across its scans. Select Raised 1 finding to go to the finding.

The check raises three kinds of finding:

Finding Severity What it means
Leaked Credential Confirmed Critical A leaked username and password signed in and passed your validation rules. Treat the password as live.
Leaked Credential Suspected High A leaked credential appeared to sign in, but the evidence is weaker than for a confirmed one. Check the account by hand.
Leaked Credential Check Info Something to know about the check itself: your validation rules also pass without a login, the login was blocked by a CAPTCHA or a lockout page, or a result could not be decided.

A credential that does not sign in raises nothing.

A finding named Leaked Credential Confirmed, rated Critical. The Evidence tab says a credential leaked for an account was replayed through the recorded login and passed the configured validation, and advises rotating the password. A Recorded result block shows the username and the login page.
A confirmed leaked credential. The finding names the account, never the password.

On the finding page, Recorded result shows the Username and the Login page. The check records the result of the replay, not its traffic, so there is no request and response to read and Reproduce is disabled.

What to do with a confirmed finding:

  1. Reset the account’s password and end its sessions.
  2. Check the account’s recent activity for sign-ins you cannot explain.
  3. Tell the user. A password that leaked from one place is probably reused in others.
  4. Consider requiring MFA. A leaked password alone does not get past it.

Each leaked credential is its own finding. Marking one as resolved or as a false positive does not touch the others. See Triage.

If you get the Info finding that says your validation is not specific to a signed-in user, fix the rules and scan again. Until then the check cannot confirm anything.

  • The leaked password is never shown. Not in the dashboard, not in a finding, not in an export, not in the API. A finding carries the account’s username and the advice to rotate.
  • Leaked credentials are encrypted when they arrive and stay encrypted at rest. Only the isolated worker that performs the replay can decrypt one.
  • They are kept for a limited time. A stored credential expires 90 days after it was last seen in breach data. Deleting the application or its project removes its stored credentials at once.
  • Logins are attempted sparingly. A scan makes at most five replay attempts in total, and at most one per account. A ceiling on attempts per account across scans, and a daily ceiling on failed attempts per application, keep the check from locking out your users or tripping your own defenses.
  • Only your application is tested. A credential is replayed against the application it was found for, through the login you recorded, and nowhere else.

A confirmed credential is tested again on every later scan that runs the check. The finding stays open for as long as the password works. When the password is changed, the next scan sees the login fail and the finding closes.

After you reset a password, you do not have to wait for the next scan. Retest that one credential from its finding page.

Rescan on a scan that ran the check starts a new scan with the check on and the same validation rules, or with the application’s saved settings if the scan followed them.

A result that could not be decided, for example because the login page was slow to answer, gets a second attempt.

The CLI has no flag for the leaked credential check. A scan started with nightvision scan runs without it. Start the scan from the dashboard or the API.

In the API an application is a target. Send these fields in the body of POST /api/v1/scans/:

Field Value
use_leaked_credential_checking true to run the check.
leaked_credential_validation_url The post-login validation URL.
leaked_credential_validation_must_contain A list of up to 8 strings.
leaked_credential_validation_must_not_contain A list of up to 8 strings.
leaked_credential_validation_status_codes Leave out for “must be 200”. A list of codes for an allowlist. An empty list to ignore the status.

Read and save an application’s settings with GET and PUT /api/v1/targets/{id}/leaked-credential-settings/. The body takes validation_url, validation_must_contain, validation_must_not_contain and validation_status_codes, with the same rules as the scan fields above. PUT replaces the saved settings, so a field you leave out is cleared. A scan created with the check on and none of the leaked_credential_validation_* fields follows the saved settings.