Skip to content
Heist/ feed
Back to feed
Medium

Grav - Arbitrary File Upload via Avatar Endpoint

Type: advisorySources: OSV

The Grav API plugin (getgrav/grav-plugin-api) 1.0.0 contains an unrestricted file upload vulnerability in the avatar upload endpoint (/api/v1/users/user/avatar). The endpoint validates only the client-declared MIME type (getClientMediaType) beginning with 'image/' and does not inspect the actual file content or restrict the resulting extension, allowing an authenticated user to store arbitrary content — including PHP code, SVG with embedded JavaScript, and polyglot payloads — under user/accounts/avatars/ with predictable filenames. Direct HTTP access to the stored files is blocked by .htaccess (returns 403), but the files persist on disk and could lead to remote code execution or stored XSS in the presence of a path traversal flaw or server misconfiguration. Fixed in 1.0.1.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2026-58654
Confirmed fixed CVEs
Not specified
Updated in this feed
4 Nov 2026, 16:39 UTC · Revision 1

Source evidence

Grav - Arbitrary File Upload via Avatar Endpoint

core-osv · Original source

Published 8 Jul 2026, 13:49 UTC

The Grav API plugin (getgrav/grav-plugin-api) 1.0.0 contains an unrestricted file upload vulnerability in the avatar upload endpoint (/api/v1/users/user/avatar). The endpoint validates only the client-declared MIME type (getClientMediaType) beginning with 'image/' and does not inspect the actual file content or restrict the resulting extension, allowing an authenticated user to store arbitrary content — including PHP code, SVG with embedded JavaScript, and polyglot payloads — under user/accounts/avatars/ with predictable filenames. Direct HTTP access to the stored files is blocked by .htaccess (returns 403), but the files persist on disk and could lead to remote code execution or stored XSS in the presence of a path traversal flaw or server misconfiguration. Fixed in 1.0.1.

osv:CVE-2026-58654
Complete source record
{
  "id": "663c7182618d85a166596818540a301b9fbc5279db8463a8ef8f0ba097e59307",
  "url": "https://osv.dev/vulnerability/CVE-2026-58654",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "Grav - Arbitrary File Upload via Avatar Endpoint",
    "summary": "The Grav API plugin (getgrav/grav-plugin-api) 1.0.0 contains an unrestricted file upload vulnerability in the avatar upload endpoint (/api/v1/users/user/avatar). The endpoint validates only the client-declared MIME type (getClientMediaType) beginning with 'image/' and does not inspect the actual file content or restrict the resulting extension, allowing an authenticated user to store arbitrary content — including PHP code, SVG with embedded JavaScript, and polyglot payloads — under user/accounts/avatars/ with predictable filenames. Direct HTTP access to the stored files is blocked by .htaccess (returns 403), but the files persist on disk and could lead to remote code execution or stored XSS in the presence of a path traversal flaw or server misconfiguration. Fixed in 1.0.1.",
    "evidence": "osv:CVE-2026-58654",
    "products": [],
    "severity": "medium",
    "structured": {
      "id": "CVE-2026-58654",
      "aliases": [
        "CVE-2026-58654",
        "GHSA-xc64-vh46-vph6"
      ],
      "metrics": [
        {
          "type": "CVSS_V4",
          "score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/getgrav/grav",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "2bb23efa7c54abcf6466a4f1326ee71d2bf2675d"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "fixed": "1.0.1"
                      }
                    ],
                    "source": "AFFECTED_FIELD",
                    "strategy": "StandardRange"
                  },
                  {
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "fixed": "1.0.1"
                      }
                    ],
                    "source": "DESCRIPTION"
                  }
                ]
              }
            }
          ],
          "versions": [
            "1.0.0",
            "1.0.0-rc.6",
            "1.0.0-rc.5",
            "1.0.0-rc.4",
            "1.0.0-rc.3",
            "1.0.0-rc.2",
            "1.0.0-rc.1",
            "0.9.45",
            "0.9.44",
            "0.9.43",
            "0.9.42",
            "0.9.41",
            "0.9.40",
            "0.9.39",
            "0.9.38",
            "0.9.37",
            "0.9.36",
            "0.9.35",
            "0.9.34",
            "0.9.33",
            "0.9.32",
            "0.9.31",
            "0.9.30",
            "0.9.29",
            "0.9.28",
            "0.9.27",
            "0.9.26",
            "0.9.25",
            "0.9.24",
            "0.9.23",
            "0.9.22",
            "0.9.21",
            "0.9.20",
            "0.9.19",
            "0.9.18",
            "0.9.17",
            "0.9.16",
            "0.9.15",
            "0.9.14",
            "0.9.13",
            "0.9.12",
            "0.9.11",
            "0.9.10",
            "0.9.9",
            "0.9.8",
            "0.9.7",
            "0.9.6",
            "0.9.5",
            "0.9.4",
            "0.9.3",
            "0.9.2",
            "0.9.0",
            "0.8.0"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-58654.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:37.460143339Z",
      "provider": "osv",
      "references": [
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/58xxx/CVE-2026-58654.json",
        "https://github.com/getgrav/grav/security/advisories/GHSA-xc64-vh46-vph6",
        "https://nvd.nist.gov/vuln/detail/CVE-2026-58654",
        "https://www.vulncheck.com/advisories/grav-arbitrary-file-upload-via-avatar-endpoint"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-434"
        ],
        "cna_assigner": "VulnCheck",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/58xxx/CVE-2026-58654.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2026-58654",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 504789,
  "published_at": "2026-07-08T13:49:08.711+00:00"
}