CVE-2020-2186: CSRF vulnerability in Amazon EC2 Plugin

org.jenkins-ci.plugins:ec2 Updated 02 Oct 2025

Summary

24/05/2022
Yes i
Low
3.1

CVE-2020-2186: CSRF vulnerability in Amazon EC2 Plugin. Affects org.jenkins-ci.plugins:ec2 versions < 1.50.2. Fixed in 1.50.2. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

Background

The Amazon EC2 Plugin is a Maven package that provides integration between Jenkins and Amazon EC2, allowing users to provision instances on Amazon EC2 as part of their Jenkins workflows. It offers various features such as launching instances, managing security groups, and configuring instance templates.

Vulnerability Detail

The Amazon EC2 Plugin version 1.50.1 and earlier is vulnerable to cross-site request forgery (CSRF) attacks. These versions do not require POST requests for several HTTP endpoints, which allows an attacker to exploit this vulnerability. By tricking a user into visiting a malicious website or clicking on a crafted link, the attacker can provision instances with an attacker-specified template ID. This can lead to unauthorized access, data leakage, or disruption of the Jenkins workflow.

How To Fix

Minimum fixed version

1.50.2

This is the first release that contains the fix.

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If upgrading to version 1.50.2 is not immediately feasible, a temporary workaround is to implement CSRF protection at the network or application layer. This can be achieved by adding CSRF tokens to the affected HTTP endpoints and validating them on the server-side. Here is an example of how to implement CSRF protection using Java Servlet Filter:

public class CsrfFilter implements Filter {
  @Override
  public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
    HttpServletRequest httpRequest = (HttpServletRequest) request;
    if (httpRequest.getMethod().equals("POST") && httpRequest.getHeader("Referer") == null) {
      // Validate CSRF token
      // ... (implementation details)
    }
    chain.doFilter(request, response);
  }
}

Note: This is just an example and may require customization based on your application's architecture and framework.

Conclusion

The CSRF vulnerability in the Amazon EC2 Plugin can be mitigated by upgrading to version 1.50.2 or later. It is important to promptly apply the fix to prevent unauthorized access and potential disruption of Jenkins workflows. For further assistance or support in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for org.jenkins-ci.plugins:ec2 →

Share this vulnerability

FAQ

Cross-Site Request Forgery (CSRF) is an attack that tricks a victim into performing unwanted actions on a web application in which they are authenticated. It occurs when an attacker can predict or control the victim's requests to the application.

The CSRF vulnerability in the Amazon EC2 Plugin can allow an attacker to provision instances with an attacker-specified template ID. This can lead to unauthorized access, data leakage, or disruption of the Jenkins workflow.

You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability. Vulert monitors and alerts in real-time for open-source vulnerabilities in software using just the pom.xml file.

Yes, upgrading to Amazon EC2 Plugin version 1.50.2 or later fixes this vulnerability. Version 1.50.2 introduces the requirement of POST requests for the affected HTTP endpoints, mitigating the CSRF vulnerability.

If upgrading to version 1.50.2 is not immediately feasible, you can implement CSRF protection at the network or application layer. This involves adding CSRF tokens to the affected HTTP endpoints and validating them on the server-side.

Related vulnerabilities

Recent vulnerabilities recorded for org.jenkins-ci.plugins:ec2.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

How To Fix

Minimum fixed version

1.50.2

This is the first release that contains the fix.

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback