/

CVE-2026-41317

Severity:

HIGH RISK

(7.5)

Cross-Site Request Forgery (CSRF) in Frappe Press

CVE-2026-41317

Analyzed

Vulnerability type

Category:

Cross-Site Request Forgery (CSRF)

CWE:

CWE-352

Impact:

Unauthorized State-Changing Requests Leading to API Secret Manipulation

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A Cross-Site Request Forgery (CSRF) flaw in the press.api.account.create_api_secret endpoint in Frappe Press allows state-changing operations to be triggered via a GET request without proper CSRF protections.

If an authenticated user visits a malicious web page, an attacker could cause unintended creation or rotation of API secrets on their account without their explicit consent.

Affected context

The vulnerability exists in deployments of the Frappe Press custom app that expose the press.api.account.create_api_secret endpoint.

The endpoint both writes to the database and is accessible via HTTP GET, making it easy to invoke through image tags, iframes, or other browser-initiated requests.

The risk materializes when users are authenticated to Frappe Press in their browser session and subsequently browse to attacker-controlled or compromised sites that can silently trigger this endpoint.

Exploit preconditions

  • Attack surface: Web-facing HTTP endpoint press.api.account.create_api_secret
  • Required access: Victim must be authenticated to the Frappe Press instance in their browser; attacker does not need direct access to the application
  • Trigger point: A crafted link, image, script, or HTML element that causes the victim's browser to send a GET request to the vulnerable endpoint
  • Why exploitation is possible: The endpoint performs state-changing operations over GET and relies on ambient browser credentials (cookies/session) without robust CSRF defenses, allowing cross-origin sites to initiate the request on behalf of the user

Why this happens

The core issue is a failure to enforce CSRF protections on a state-changing endpoint, combined with the use of the GET method for an operation that writes to the database.

This maps to CWE-352: Cross-Site Request Forgery, where a web application relies solely on browser-managed authentication (e.g., cookies) and does not validate that the request originated from a trusted user action or same-site context.

By allowing a side-effectful action (API secret creation) via GET without verification tokens or strict SameSite/session controls, the application implicitly trusts any authenticated browser request, including those initiated from attacker-controlled pages.

Potential impact

  • Creation of unintended API secrets that an attacker may trick users into generating for later misuse
  • Silent rotation or proliferation of API credentials, increasing the chance of accidental disclosure or mismanagement
  • Loss of user control over their own API credential lifecycle and configuration
  • Indirect facilitation of further abuse if generated secrets are exfiltrated through social engineering or other channels

General mitigation guidance

CSRF mitigation typically focuses on ensuring that state-changing operations require explicit, same-site user intent and are not triggerable by arbitrary cross-origin requests.

Recommended defensive patterns include:

  • Restricting state-changing endpoints (such as API secret creation) to HTTP POST or other non-GET methods, following RESTful semantics
  • Enforcing CSRF tokens or similar anti-forgery mechanisms on all authenticated, state-changing requests, with server-side validation
  • Applying SameSite cookie attributes and considering additional session-binding mechanisms to reduce credential usage across untrusted origins
  • Designing API secret management flows to require explicit user interaction and, where appropriate, re-authentication or step-up verification
  • Centralizing authorization checks and CSRF enforcement at the framework/middleware layer to avoid per-endpoint gaps

These patterns help ensure that browser-initiated requests reflect genuine user actions rather than attacker-crafted cross-origin interactions.

How teams detect issues like this

CSRF-related issues are best identified through a combination of design review, automated checks, and targeted testing.

Possible detection strategies include:

  • Static analysis rules or security linters that flag state-changing handlers exposed via GET or without CSRF decorators/middleware
  • Framework-level configuration auditing to ensure all authenticated write endpoints are covered by CSRF protection mechanisms
  • Code review practices that treat any "write to database" or "security-sensitive action" over GET as a red flag
  • Application security testing (manual or automated) that attempts cross-origin invocation of sensitive endpoints from attacker-controlled pages
  • Security policies in CI/CD that prevent merging of routes lacking proper HTTP verb usage and CSRF controls

Automated tools can augment manual review by systematically scanning for misconfigured routes and inconsistent enforcement of CSRF protections.

Sources

SourceLink
github.comgithub.com/frappe/press/commit/52ea2f2d1b587be0807557e96f025f47897d00fd
github.comgithub.com/frappe/press/security/advisories/GHSA-q4wg-jrr8-vpwf

Frequently asked

questions

Yes. An attacker can exploit this remotely by luring an authenticated user to visit a malicious or compromised website that triggers the vulnerable endpoint through the user's browser.

The attacker does not need their own account but relies on the victim being authenticated in their browser. The attack succeeds with the privileges of the victim user whose session cookies or credentials are present.

The safest pattern is to ensure that all state-changing endpoints use non-GET methods (typically POST) and are uniformly protected by CSRF defenses such as anti-forgery tokens enforced at the framework or middleware level.

Adopting a security-by-design approach helps: treat all write operations as requiring POST/PUT/DELETE, enforce CSRF protection globally for authenticated operations, use secure cookie attributes, and incorporate automated checks in code review and CI pipelines to flag any new state-changing GET endpoints or missing CSRF annotations.

Find out what's already
exploitable in your codebase.