Skip to content
CSRF Advisory Intermediate CVE-2023-37957

GHSL-2023-064: Cross-Site Request Forgery (CSRF) and Server-Side Request Forgery (SSRF) in jenkinsci/pipeline-restful-api-plugin - CVE-2023-37957

The Jenkins plugin's token generation endpoint lacked CSRF protection and allowed an attacker to specify a callback URL, so a crafted link could make a logged-in victim send their API token to an attacker-controlled server. The attacker could then use that token to impersonate the victim.

Alvaro Muñoz Follow

Originally disclosed on GitHub Security Lab

A Cross-Site Request Forgery (CSRF) and a Server-Side Request Forgery (SSRF) vulnerabilities in jenkinsci/pipeline-restful-api-plugin may allow an attacker to retrieve a token to impersonate its victim.

pwntester, on GitHub Security Lab

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the token generation endpoint did not require a CSRF token and accepted an arbitrary callback URL, allowing the generated token to be sent to an attacker-controlled server.

Impact

This could lead to sensitive credential leakage, account takeover, and remote code execution.

What the attacker needed

Victim is authenticated to Jenkins; victim visits attacker-crafted link

How it was found

  1. The attacker prepares a URL that points to the Jenkins instance's token generation endpoint and sets the callback parameter to an attacker-controlled server.
  2. The attacker sends this link to a victim who is logged in to Jenkins.
  3. When the victim visits the link, Jenkins generates a new API token for the victim and sends it via a POST request to the attacker's server.
  4. The attacker receives the token and uses it with the JCLI tool to impersonate the victim.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

This is a web security bug in a Jenkins plugin. When a logged-in user visits a special link, their browser automatically sends a request to the Jenkins server that creates a new API token. Because the request has no protection against being triggered from another site, and because the attacker can choose where the token is sent, the token ends up on the attacker's server. The attacker can then use that token to act as the victim.

What is CSRF?

Another site makes a signed-in user's browser perform an action they did not intend.

More by Alvaro Muñoz

View all

132 more disclosed reports, best first.

More from GitHub Security Lab

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site request forgery (CSRF)

The lesson behind this report.

Another site makes a signed-in user's browser perform an action they did not intend.