Search
Close this search box.

Blog

Device Code Phishing: How Malicious Actors Can Compromise Your Accounts

Alex Martirosyan

ABOUT THE AUTHOR

Alex Martirosyan

Manager

Read Bio

AREAS OF EXPERTISE

Financial Services
Healthcare
Manufacturing
Distribution & Retail
Technology

Share

LinkedIn
Facebook
Threads
X
Reddit
Email

In a past DenSecure blog, we examined the shortcomings of many security awareness training programs. To extend the discussion, this post will dive into the technical details of a social engineering attack that targets the device code authentication flow.

Many applications and cloud services support device code authentication, and you may already be familiar with this protocol if you have set up any popular streaming services for family members, such as Netflix, Hulu, etc. Therefore, we will examine how to abuse this protocol and demonstrate how a malicious actor can compromise Microsoft 365 accounts, since “simply reporting on a click rate or credential compromise rate alone does not matter.”

Example Authentication

The device code authentication process assists in authenticating devices where a traditional browser or interactive session may not be possible. For example, a TV, command shell, and more can take advantage of this flow to gain access to resources, such as your most recent binge-worthy show.

As defined in RFC8628, an attacker can perform a social engineering attack by instructing a target to register a malicious application using a device code. Below is an example of the authentication process for Netflix to authenticate a TV:

Device Code Authentication Flow

Outside of streaming services, cloud providers have also implemented this protocol. For instance, Microsoft 365 supports this authentication flow. They stated, The Microsoft identity platform supports the device authorization grant, which allows users to sign in to input-constrained devices such as a smart TV, IoT device, or a printer. To enable this flow, the device has the user visit a webpage in a browser on another device to sign in. Once the user signs in, the device is able to get access tokens and refresh tokens as needed.”

Microsoft Device Flow

By default, this endpoint is accessible, and any user can complete this flow. The trick is that anyone can generate the device code and if the target victim completes the authentication flow, we receive their access/refresh tokens. The code generation is well documented and trivial to complete as seen in the following Microsoft example:

This can easily be extended and deployed in a social engineering attack as documented here.

In this attack, we are relying on Microsoft 365 entirely to create our phishing infrastructure. This attack builds trust not only with a target, but with a variety of security controls.

If you are a defender, or authorized security tester that only considers users that click a link as “failed,” it is time to reconsider security testing and awareness. Training is often built to showcase the skills of marketing, instead of actually providing valuable and actionable information for end users. Instead of just focusing on clicks (already unrealistic), users need to be trained on valid authentication flows and feel comfortable reporting abnormal requests. More on this has been detailed by TheParanoids in this article.

As always with a strong enough pre-text, the majority of users will most likely authorize an application. Do you have confidence in your users and have you tested them? For more information, please reach out to a member of our DenSecure team.

CONTACT
Alex Martirosyan

Alex Martirosyan

Alex is a Lead Penetration Tester at Wolf’s IT Assurance Services group where he’s responsible for coordinating and conducting penetration…

Read Bio

"*" indicates required fields

This field is for validation purposes and should be left unchanged.
Get the insights that matter.

Stay informed with priority news and key industry updates by filling out the form to subscribe.
Name*
This field is hidden when viewing the form

Connect with a Wolf Expert

"*" indicates required fields

This field is for validation purposes and should be left unchanged.

Wolf Inquiry Form

Fill out the form below and our team will reach out to you soon.
Name*

Newsletter (Insight & Case Study | Wolf Website

"*" indicates required fields

This field is for validation purposes and should be left unchanged.
Get the insights that matter.

Stay informed with priority news and key industry updates by filling out the form to subscribe.
Name*
This field is hidden when viewing the form

Data Solutions | LinkedIn Ads Form

"*" indicates required fields

This field is for validation purposes and should be left unchanged.

Data Solutions Inquiry Form

Fill out the form below and our team will reach out to you soon.
Name*

Get back to business with accounting support from Wolf & Company.

"*" indicates required fields

This field is for validation purposes and should be left unchanged.

Outsourced Accounting Solutions Inquiry Form

Fill out the form below and our team will reach out to you soon.
Name*

Data Solutions | Page

Get back to business with accounting support from Wolf & Company.

"*" indicates required fields

This field is for validation purposes and should be left unchanged.
Fill out the form below and our team will reach out to you soon.
Name*

"*" indicates required fields

This field is for validation purposes and should be left unchanged.

Data Solutions Inquiry Form

Fill out the form below and our team will reach out to you soon.
Name*

Connect with a Wolf Expert

"*" indicates required fields

This field is for validation purposes and should be left unchanged.

Wolf Inquiry Form

Fill out the form below and our team will reach out to you soon.
Name*

Fintech Inquiry Form

Fill out the form below and our team will reach out to you soon.
Name(Required)

Fintech Inquiry Form

Fill out the form below and our team will reach out to you soon.

Get back to business with accounting support from Wolf & Company.

"*" indicates required fields

This field is for validation purposes and should be left unchanged.

Outsourced Accounting Solutions Inquiry Form

Fill out the form below and our team will reach out to you soon.
Name*

"*" indicates required fields

This field is for validation purposes and should be left unchanged.

DenSecure Inquiry Form

Fill out the form below and our team will reach out to you soon.
Name*

We’re here to help.

"*" indicates required fields

This field is for validation purposes and should be left unchanged.
Fill out the form below and our team will reach out to you soon.
Name*
This field is hidden when viewing the form