Cybersecurity experts and organizations that rely on Amazon Web Services (AWS) are furious about a new vulnerability. This vulnerability has been assigned CVE-2025-51591. Attackers can exploit this Server-Side Request Forgery (SSRF) vulnerability by injecting HTML iframe elements. This move endangers key federal systems and could have disastrous effects on the overall cloud infrastructure. This vulnerability has a CVSS score of 6.5. It can open the door for bad actors to view sensitive information and use internal applications.
The ramifications of taking advantage of SSRF vulnerabilities in cloud environments such as AWS can be far-reaching. Threat actors can take advantage of these vulnerabilities to steal cloud credentials, perform network reconnaissance, and access internal services without authorization. Here’s what organizations need to do today. For one, they need to require IMDSv2 be used for all EC2 instances in order to guard against potential SSRF-style attacks.
Understanding CVE-2025-51591
The vulnerability is due to how Pandoc renders <iframe> tags in resulting HTML documents. Pandoc is probably the most widely known tool for converting between multiple document formats. Exploitation An attacker can exploit this flaw by simply creating an iframe that targets the AWS Instance Metadata Service (IMDS) server. This stage simplifies data exfiltration from sensitive directories.
“The vulnerability, tracked as CVE-2025-51591, stems from Pandoc rendering
Once the attacker successfully injects a crafted HTML document containing an iframe targeting the IMDS endpoint at 169.254.169.254, they can render and exfiltrate sensitive information such as IAM role credentials. This capability transforms the vulnerable application into a proxy, effectively bypassing traditional security measures such as IP whitelists.
"The attacker submitted crafted HTML documents containing
Risks Associated with SSRF Exploits
The risks associated with SSRF vulnerabilities are particularly concerning for organizations operating on cloud platforms like AWS. When exploited, these vulnerabilities can lead to significant security breaches, including cloud credential theft and unauthorized access to internal resources. Mandiant researchers noted that since July 2021, a threat actor known as UNC2903 has successfully attacked AWS environments by abusing credentials obtained through IMDS.
"Although Amazon recommends implementing the IMDSv2 with GuardDuty enhancements, EC2 instances created by Amazon customers that instead use IMDSv1 may be at risk when combined with also running unpatched vulnerable third-party software," – Mandiant researchers.
In addition to credential theft, attackers can use SSRF exploits for network reconnaissance, identifying sensitive internal services that are otherwise protected by perimeter firewalls. This capability allows them to reach internal assets that would typically be unreachable.
"Since SSRF originates from within the server, it can reach endpoints protected by perimeter firewalls. This effectively turns the vulnerable application into a proxy," – Resecurity.
Recommended Security Measures
Organizations leveraging AWS are strongly advised to adopt several security practices to mitigate the risks posed by CVE-2025-51591 and similar vulnerabilities. The enforcement of IMDSv2 across all EC2 instances is a crucial step in enhancing security against SSRF attacks. IMDSv2 offers improved protection by requiring session-based tokens for accessing instance metadata, thereby reducing the likelihood of unauthorized access.
Moreover, adhering to the principle of least privilege (PoLP) is essential for minimizing the potential impact of an IMDS compromise. By assigning roles with restricted permissions, organizations can contain any damage that may arise from a successful attack.
It is imperative for organizations to remain vigilant and regularly update their security measures in response to emerging threats. As cyber attackers continually evolve their tactics, maintaining robust security practices is vital for safeguarding sensitive data and maintaining trust in cloud infrastructure.