Attacks Targeting ADFS Token Signing Certificates Could Become Next Big Threat
New research shows how threat actors can steal and decrypt signing certificates so SAML tokens can be forged.
April 28, 2021
![](https://eu-images.contentstack.com/v3/assets/blt6d90778a997de1cd/bltc94608acf452fd67/655cf371ab171e040a838b2a/329050_DR23_Graphics_Website_V5_Default_Image_v1.png?width=1280&auto=webp&quality=95&format=jpg&disable=upscale)
Conventional access control and detection mechanisms alone are no longer sufficient to protect enterprise Active Directory Federation Services (ADFS) environments against targeted attacks.
With organizations increasingly adopting cloud services, threat actors have begun focusing on ADFS as an avenue to gain and maintain long-term access on Microsoft 365 and other cloud-based services environments, according to a new FireEye Mandiant report, out Tuesday.
"[ADFS] is the linchpin that ties together the corporate network with various cloud services like Microsoft 365," says Doug Bienstock, manager at Mandiant. "As more organizations move to the cloud, ADFS and its analogs will increasingly be targeted."
Mandiant's report highlights a previously unknown method for stealing and decrypting a digital signing certificate from an ADFS server so it can be used to forge SAML tokens for accessing an organization's cloud services accounts as any user, at any time, without authentication.
The notion of attackers using forged SAML tokens to freely access enterprise resources on-premises and in the cloud is not new. CyberArk first described the technique, which it dubbed "Golden SAML," back in 2017. The SolarWinds attack disclosed last December marked the first time a threat actor was observed actually using the technique to bypass authentication mechanisms — including multifactor — to gain access to an enterprise cloud services environment.
Mandiant's tactic takes advantage of the fundamental process by which ADFS enables federated identity and access management in enterprise environments. To enable single sign-on access to enterprise apps on-premises and in the cloud, ADFS first verifies a user's identity using Active Directory and then issues SAML tokens containing digitally signed assertions that describe the user. Applications such as Microsoft 365 use the tokens to authorize the appropriate level of access to users.
"The Token Signing Certificate is the bedrock of security in ADFS," Bienstock writes in Mandiant's report. "Microsoft 365 uses the digital signature to validate that the SAML token is authentic, valid, and comes from an ADFS server that it trusts."
Stealing the tokens can be relatively difficult in default ADFS configurations where the token signing certificate is stored in encrypted form in a tightly restricted internal Windows database on the ADFS server. Controls such as secure credential management, network segmentation, and EDR can all hamper an attacker's ability to access an ADFS server and the token signing certificate.
However, the situation is different in environments where multiple ADFS servers have been deployed for load-balancing and high-availability purposes. The multiple individual ADFS nodes in these so-called farm configurations use a replication service to share and sync configuration info and certificates from the primary server.
The whole process by which this happens gives attackers an opening to steal the token signing certificate simply by accessing the ADFS server over the standard HTTP port and decrypting it using any domain user credentials. "This would give them persistent ability to perform a Golden SAML attack with only access to the network as a requirement," Bienstock states in the report. Because ADFS replication events are not logged, the technique is hard to detect.
"This technique will work in environments that are actually configured as a farm as well as in ones where there is only a single ADFS server for the entire organization," he says.
Typically, when organizations use multiple ADFS servers, the servers share the same token signing certificate. But even when individual ADFS servers in a farm are configured to use unique token signing certificates, Mandiant's method for stealing and decrypting them should work, Bienstock says. "This is untested, but it should still work," he says. "In those cases, the threat actor would extract one particular token signing certificate" and use it to access applications.
To defend against the threat, security administrators need to ensure that only ADFS servers in the farm have access to port 80 TCP. They also need to implement specific measures for limiting inbound communications and monitoring the internal network for specific activity, according to the report, which contains specific mitigation measures for administrators.
Bienstock says that just because there are no public reports — other than SolarWinds — of attackers using the Golden SAML technique doesn't mean there haven't been any previously. "We always say the absence of evidence is not evidence of absence," he says.
"This technique is particularly difficult to detect," he adds. "That is why we want to make sure defenders are aware of it and aware of the mitigations to take to prevent this technique from being successful in the first place."
About the Author
You May Also Like
Catch the Threat Before it Catches you: Proactive Ransomware Defense
September 5, 2024How to Evaluate Hybrid-Cloud Network Policies and Enhance Security
September 18, 2024DORA and PCI DSS 4.0: Scale Your Mainframe Security Strategy Among Evolving Regulations
September 26, 2024Harnessing the Power of Automation to Boost Enterprise Cybersecurity
October 3, 2024
[Virtual Event] The Essential Guide to Cloud Management
October 17, 2024Black Hat Europe - December 9-12 - Learn More
December 10, 2024SecTor - Canada's IT Security Conference Oct 22-24 - Learn More
October 22, 2024