Your authenticator app’s QR setup code (the square barcode you scan to add two-factor authentication) encodes the secret key that generates your 6-digit codes. If that QR or its embedded secret is exposed in a breach, an attacker can generate the same codes you do. This guide explains, in plain language, what to rotate, how to rotate it without locking yourself out, and what to monitor afterward.
What a QR Setup Code Actually Contains
Most authenticator apps (Google Authenticator, Microsoft Authenticator, Authy, 1Password, etc.) use TOTP: Time-Based One-Time Passwords. When you enroll a site in your authenticator, the site gives you a secret (also called a seed or shared key). The QR code is simply a convenient way to deliver that secret to your app.
- If the QR or secret is exposed: Anyone with that secret can generate your 6-digit codes on any device.
- What doesn’t help: Changing your phone, reinstalling the app, or clearing tokens won’t protect you unless you also change the secret with the service.
- What does help: Rotating the secret for each affected account (re-enrolling 2FA so a brand-new secret replaces the exposed one).
How to Confirm Exposure and Prioritize Your Response
If a breach notice or incident suggests that QR setup codes, TOTP seeds, or recovery files may have leaked, treat it as a compromise. Prioritize accounts in this order:
- Email accounts (especially the one that receives account resets).
- Financial accounts (banks, credit cards, brokerages, payment apps).
- Cloud identity and password managers (Apple ID, Google, Microsoft, password vaults).
- Primary social, shopping, and work accounts (GitHub, Amazon, Office 365, Slack, etc.).
Why prioritize this way? If an attacker controls your email or financial accounts, they can pivot quickly to take over more services or extract money and sensitive data.
Immediate Containment Steps
- Do not delete working 2FA entries yet. You need them to sign in and rotate properly.
- Enable a new device lock/PIN and screen lock if not already enabled.
- Back up recovery methods (backup codes, security keys, recovery email/phone) before making changes.
- Check for unusual logins and sign out from unrecognized sessions across key accounts.
What “Rotate” Means (and Why It’s Essential)
Rotating your authenticator factors means replacing the old, exposed TOTP secret with a brand-new one issued by the service. After rotation, the old secret no longer works to generate valid codes. This is not the same as moving your authenticator app to a new phone—the service itself must issue a new secret.
Rotation Playbook: Step-by-Step for Each Account
Repeat the process below for every account you enrolled with the exposed QR code or secret. Exact wording varies by service, but these steps are reliable.
- Sign in normally using your current password and 2FA code (from the exposed secret). Do this quickly to reduce the window of risk.
- Navigate to Security settings (often called Security, Login & Security, or Account Protection).
- Find Two-Factor Authentication (2FA) / MFA settings and locate your current authenticator setup.
- Remove or disable the existing authenticator or choose “Replace,” “Change,” or “Reset” authenticator. If forced to disable first, be prepared to re-enable immediately with a new secret.
- Re-enroll the authenticator:
- Choose “Set up authenticator app.”
- When the new QR appears, confirm it’s new (the account name or secret should differ from your previous one).
- Scan with your authenticator app or manually enter the shown secret (Base32 string).
- Verify with a 6-digit code from the new entry.
- Save new backup codes if the service offers them. Store them offline in a safe place.
- Delete the old authenticator entry from your app to avoid confusion later.
Platform-Specific Tips
- Google Account: Security > 2-Step Verification > Authenticator app > Change Phone or Set up authenticator. Confirm the app shows a new entry; remove the old one after verification.
- Microsoft Account: Security > Advanced security options > Two-step verification > Turn off, then Set up a new Authenticator app. If using push approvals, ensure TOTP is re-issued where supported.
- Apple ID: Uses built-in prompts/SMS by default; if you added a third-party authenticator to certain Apple services, re-enroll those. Ensure trusted devices and phone numbers are current.
- GitHub, AWS, Cloud Providers: Replace TOTP and rotate any hardware keys’ resident credentials if applicable. Store new recovery codes securely.
- Password Managers: Follow provider guidance. Some allow multiple authenticators—remove old seeds after adding the new one.
What Else to Rotate Beyond the Authenticator
When secrets are exposed, treat related authentication factors as potentially risky too.
- Passwords: Rotate passwords for accounts where 2FA was exposed, starting with email and finance. Use unique, long passphrases and store them in a password manager.
- Backup codes: If backup codes were stored alongside exposed data, regenerate them. Destroy any copies you can no longer trust.
- Recovery email and phone: Verify they are accurate and not compromised. Remove outdated recovery options.
- App passwords and API tokens: Revoke and reissue any tokens that could allow login without 2FA.
- Session tokens: After rotation, sign out everywhere to invalidate old sessions where the attacker may be logged in.
Special Cases: When You Can’t Log In
If an attacker used the exposed secret and changed settings before you could:
- Use backup codes to regain access and rotate immediately.
- Try alternate recovery methods (security keys, recovery email, recovery phone, customer support with identity verification).
- Contact the provider’s account recovery team and reference unauthorized 2FA exposure. Ask for a temporary 2FA reset so you can re-enroll with a new secret.
Should You Switch to Security Keys?
Hardware security keys (FIDO2/WebAuthn) resist phishing and do not expose a reusable shared secret like TOTP. Consider adding at least two keys (primary and backup) to critical accounts. Keep TOTP as a fallback only if required, and rotate TOTP secrets even when adding keys.
How to Avoid Future Exposure
- Never store raw QR codes or TOTP secrets in screenshots or cloud photos. If you must keep a record, store the backup codes offline in a safe place; avoid saving the TOTP secret itself.
- Use a password manager with 2FA support to securely store and sync TOTP secrets, protected by a strong master password and MFA.
- Lock your device and authenticator app with biometrics or a strong PIN. Disable screen overlay previews for authenticator notifications.
- Beware of phishing pages that request scanning a “support” QR code or ask you to share your 6-digit codes.
- Segment accounts: Use separate emails for banking, shopping, and personal logins to reduce blast radius.
Post-Rotation Monitoring: What to Watch
After you finish rotating secrets, your focus shifts to detecting any fallout from the exposure.
- Unexpected login alerts or password reset emails.
- New devices or locations added to your accounts.
- Financial anomalies such as small test charges, new credit inquiries, or account changes.
- Email forwarding rules or filters you did not create (attackers use these to hide takeover activity).
If the exposed QR codes were tied to accounts with financial implications, consider ongoing monitoring. A dedicated monitoring tool can alert you to changes that may indicate identity misuse and help you respond quickly. For many readers, it’s helpful to use a service that combines privacy, credit monitoring, and identity alerts in one place—see our overview of options here: SmartCredit for privacy, credit monitoring, and identity protection.
Frequently Asked Questions
Is rotating the authenticator enough?
It’s essential, but also rotate passwords for high-risk accounts, regenerate backup codes, sign out of all sessions, and review recovery options. If API or app passwords exist, revoke and reissue them.
What if I only saw the QR code briefly—could someone still use it?
Yes. A single screenshot or scan is sufficient to clone your 2FA codes indefinitely until you rotate the secret.
Do I need to delete and reinstall my authenticator app?
Not necessarily. Reinstalling doesn’t invalidate the exposed secret. The fix must happen on each account by issuing a brand-new secret.
Can attackers generate past or future codes if they have the secret?
They can generate valid current and future codes as long as the secret remains active. They cannot “rewind” time to bypass server-side checks, but they don’t need to—current codes will work.
What about SMS-based 2FA?
This exposure targets app-based TOTP. If you also used SMS, verify your phone number is correct and consider adding security keys. SMS alone is weaker and vulnerable to SIM-swap attacks.
A Practical Checklist You Can Follow Today
- List all accounts that used the exposed QR/secret.
- Prioritize: email, finance, cloud identity, then everything else.
- For each account: sign in, disable or replace authenticator, re-enroll to get a new secret, verify, save new backup codes, and remove the old entry from your app.
- Rotate passwords for priority accounts; ensure they’re unique and strong.
- Revoke suspicious sessions, app passwords, and API tokens.
- Audit recovery methods and remove anything outdated or unknown.
- Add hardware security keys for critical logins where supported.
- Review and harden device security (screen lock, app lock, no screenshots of secrets).
- Monitor for unusual activity and set up alerts on key accounts.
Conclusion
If an authenticator QR setup code is exposed, assume the underlying TOTP secret is compromised. The only real fix is rotation—re-enroll two-factor authentication on every affected account so each issues a new secret, then clean up passwords, backup codes, sessions, and recovery options. Work through your accounts in priority order and consider adding hardware security keys for long-term resilience. Finally, keep an eye on your accounts and financial identity; timely monitoring and alerts can turn a potential crisis into a contained incident.
Good to Know
A QR authenticator setup code is just a visual form of the long secret key that generates your 2FA codes; if someone else has that secret, your current login codes can be cloned until you rotate it.