Example mitigation rules (2)
Last updated May 5, 2026
Rate limit suspicious logins with leaked credentials
Note
Access to the cf.waf.credential_check.username_and_password_leaked field requires a Pro plan or above.
Create a rate limiting rule using account takeover (ATO) detection and leaked credentials fields to limit volumetric attacks from particular IP addresses, JA4 Fingerprints, or countries.
The following example rule applies rate limiting to requests with a specific ATO detection ID (corresponding to Observes all login traffic to the zone) that contain a previously leaked username and password:
When incoming requests match:
(any(cf.bot_management.detection_ids[*] eq 201326593) and cf.waf.credential_check.username_and_password_leaked)
With the same characteristics: IP
When rate exceeds:
- Requests:
5 - Period: 1 minute
Challenge requests containing leaked credentials
Note
Access to the User and Password Leaked (cf.waf.credential_check.username_and_password_leaked) field requires a Pro plan or above.
Create a custom rule that challenges requests containing a previously leaked set of credentials (username and password).
- Expression: If you use the Expression Builder, configure the following expression:
| Field | Operator | Value |
|---|---|---|
| User and Password Leaked | equals | True |
If you use the Expression Editor, enter the following expression:
txt
(cf.waf.credential_check.username_and_password_leaked)
- Action: Managed Challenge
Was this helpful?
YesNo
On this page
{"@context":"https://schema.org","@type":"TechArticle","@id":"https://developers.cloudflare.com/waf/detections/leaked-credentials/examples/#page","headline":"Example mitigation rules","description":"Examples of rules for mitigating requests containing leaked credentials.","url":"https://developers.cloudflare.com/waf/detections/leaked-credentials/examples/","inLanguage":"en","image":"https://developers.cloudflare.com/waf/detections/leaked-credentials/examples/og.png?v=23ffe249e1a10e47","dateModified":"2026-05-05","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"},"keywords":["Account takeover"]}
description: Enable leaked credentials detection and configure custom or managed detections. title: Get started image: https://developers.cloudflare.com/waf/detections/leaked-credentials/get-started/og.png?v=c1fc951010425434
Documentation Index
Fetch the complete documentation index at: https://developers.cloudflare.com/waf/llms.txt
Use this file to discover all available pages before exploring further.
Docs