Category: Cybersecurity

  • The login code trick: how attackers get into Microsoft 365 without your password

    Most phishing advice comes down to one rule: check the web address before you sign in. This scam passes that test. The page is genuine, the sign-in is genuine, and your two-step login works exactly as it should. The criminal still ends up inside your mailbox.

    It is called device code phishing, and it has become one of the busiest ways into Microsoft 365 accounts this year.

    How the trick works

    Some devices have no proper keyboard, such as a smart TV, a conference room screen or a command-line tool. To sign those in, Microsoft shows a short code. You open a Microsoft page on your phone or laptop, type the code, sign in as normal, and the device is connected to your account.

    The criminal starts that same process on their own computer and gets a code. They send it to you in an email dressed up as an invoice, a payment notice or a shared document, with a line like "enter this code to view the file." You go to the real Microsoft page, type the code and approve the sign-in. You have just connected the criminal's computer to your account. Nothing looked fake, because nothing was.

    How common it is

    In April, Microsoft said it was seeing 10 to 15 new device code campaigns every 24 hours, with hundreds of accounts taken over each day. Ready-made kits for the scam are sold to other criminals as a service. The lures look like requests for proposals, invoices and everyday business paperwork, and staff who handle money are a favorite target.

    Once inside, attackers often set up mailbox rules that quietly forward emails mentioning words like "invoice" or "payroll." Some also register a new device to the account within minutes, so they keep access even after a password change.

    It has not gone away. In its weekly roundup on November 30, The Hacker News reported a fresh wave in November, using payment emails and shared-document lures.

    Why MFA does not stop it

    Two-step login proves that the person signing in is you. In this scam, it is you: you complete the MFA step yourself, on the real site. Even a passkey or security key cannot tell that the session you are approving belongs to someone else. That is why the fix is to remove the opening, not just to strengthen the lock.

    What we recommend

    1. Turn off device code sign-in for everyone who does not need it. Microsoft recommends that organizations "get as close as possible to a unilateral block" on this kind of sign-in. In Microsoft 365 this is a Conditional Access policy, which needs Microsoft Entra ID P1. That is included in Microsoft 365 Business Premium.
    2. Test before you switch it on. Run the policy in report-only mode first to see who still uses device codes, and keep your emergency admin account excluded.
    3. Teach one simple rule. Only enter a sign-in code for a sign-in you started yourself, a few seconds earlier. An email that asks you to type a code anywhere is a red flag.
    4. Check mailbox rules. Look for rules that forward, move or delete emails about invoices, payments or payroll. Most people never set these up themselves.
    5. Act fast if someone typed a code. Tell whoever runs your IT as soon as possible. Signing the person out everywhere, resetting the password, removing unknown devices and checking mailbox rules should all happen the same day.

    The takeaway

    This scam works because it uses Microsoft's own sign-in page against you. The best defense is to close a door most businesses never use, and to make "only enter codes you asked for" a habit. If you would like us to check whether device code sign-in is open in your Microsoft 365 and switch it off safely, that is a quick, practical job we do at FarSecure.

    Sources