
Cloud Vulnerability DB
A community-led vulnerabilities database
CVE-2025-54956 is an information disclosure vulnerability in the gh package for R (maintained by r-lib/Posit) where HTTP responses are returned in a data structure that also includes the Authorization header from the originating HTTP request. This means any GitHub API token passed to gh() calls is embedded in the returned R object. The vulnerability affects all versions of the gh package before 1.5.0. It was disclosed on August 3, 2025, with the fix committed shortly after. It carries a CVSS v3.1 base score of 3.2 (Low), reflecting a local, high-complexity attack vector with changed scope but limited confidentiality impact (Feedly, GitHub Issue).
The root cause is classified as CWE-669 (Incorrect Resource Transfer Between Spheres): the gh_process_response() function in R/gh_response.R attached the full request object — including its headers field containing the Authorization header — as an attribute of the returned response object. This means the GitHub API token is stored in the R object returned to the caller. The fix (commit b575d48) introduced a remove_headers() helper that strips the headers key from the request before attaching it to the response, and updated pagination functions (gh_next(), gh_prev(), gh_first(), gh_last()) to accept explicit .token and .send_headers parameters instead of relying on stored request headers (GitHub Commit, GitHub Issue). The issue was responsibly disclosed by researcher @foysal1197 and acknowledged under Posit Security Advisory PSA-1649 (GitHub Commit).
The primary risk is inadvertent exposure of GitHub API tokens (Personal Access Tokens or OAuth tokens). If a user serializes the gh() return value — for example, saving it as an .rds file and committing it to a public or shared repository — the embedded Authorization header would expose the token to anyone with access to that file. This could allow an attacker who obtains the serialized object to authenticate to the GitHub API with the victim's credentials, enabling unauthorized access to repositories, organization data, or other GitHub resources scoped to that token (GitHub Issue, Feedly).
There is no evidence of active in-the-wild exploitation, and no public exploit code or PoC has been identified. The EPSS score is approximately 0.011% (0.000110), indicating very low probability of exploitation in the near term. The vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog. Exploitation requires local access to a serialized R object (e.g., an .rds file) that was created using a vulnerable version of the gh package and then shared or committed to a repository (Feedly).
.rds files committed by R users who use the gh package..rds file from the public or accessible repository.readRDS('file.rds') to load the object into an R session.attr(obj, 'request')$headers or inspect the headers element to retrieve the Authorization value containing the GitHub token.curl -H 'Authorization: token <extracted_token>' https://api.github.com/user) to access the victim's GitHub account and resources (GitHub Issue, GitHub Commit)..rds files in R project directories or repositories that, when loaded, contain an attr(..., 'request') with a headers field including an Authorization key — indicative of objects saved with a vulnerable gh version before 1.5.0..rds file.Upgrade the gh R package to version 1.5.0 or later, which removes the Authorization header from the request object stored in the response. Users who previously saved gh() return values to .rds files or other serialized formats should treat those files as potentially containing sensitive tokens, revoke and rotate any exposed GitHub tokens immediately, and regenerate the cached objects using the patched version. The fix is available via CRAN and the r-lib GitHub repository (GitHub Commit, GitHub Compare). Debian LTS users can apply the security update announced in DLA-4378-1 (Debian LTS).
The issue was originally filed by Hadley Wickham (r-lib maintainer) on April 23, 2025, who noted the practical risk of users caching API responses as .rds files and accidentally committing them to GitHub, thereby exposing API keys. Posit formally acknowledged the issue under security advisory PSA-1649 and credited researcher @foysal1197 for responsible disclosure. A Medium article summarizing the vulnerability was published shortly after the CVE was assigned (Medium, GitHub Issue).
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."