GitHub Advisoryadvisory · PyPI
GHSA-ghq9-vc6f-8qjf TorchGeo Remote Code Execution Vulnerability
HIGH
Official page ↗
- Aliases
- CVE-2024-49048
- Ecosystem
- PyPI
- Packages
- torchgeo
- Severity
- High
- CVSS vector
- CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
- Weaknesses
- CWE-94, CWE-95
- Reviewed
- 2026-04-01
Affected packages
• PyPI torchgeo: >= 0.4, < 0.6.1 → fixed in 0.6.1
Description
Impact
TorchGeo 0.4–0.6.0 used an `eval` statement in its model weight API that could allow an unauthenticated, remote attacker to execute arbitrary commands. All platforms that expose `torchgeo.models.get_weight()` or `torchgeo.trainers` as an external API could be affected.
Patches
The `eval` statement was replaced with a fixed enum lookup, preventing arbitrary code injection. All users are encouraged to upgrade to TorchGeo 0.6.1 or newer.
Workarounds
In unpatched versions, input validation and sanitization can be used to avoid this vulnerability.
References
Bug history
• Introduced: https://github.com/torchgeo/torchgeo/pull/917
• Patched: https://github.com/torchgeo/torchgeo/pull/2323
• Released: v0.6.1
Related
Alias · CVE (1)
- CVE-2024-49048 TorchGeo Remote Code Execution Vulnerability vulnerability
References
- https://github.com/torchgeo/torchgeo/security/advisories/GHSA-ghq9-vc6f-8qjf web
- https://nvd.nist.gov/vuln/detail/CVE-2024-49048 advisory
- https://github.com/torchgeo/torchgeo/pull/2323 web
- https://github.com/torchgeo/torchgeo/pull/917 web
- https://github.com/torchgeo/torchgeo/commit/1a980788cb7089a1115f3b786c7daa9dd47d7d7a web
- https://github.com/microsoft/torchgeo/releases/tag/v0.6.1 web
- https://github.com/pypa/advisory-database/tree/main/vulns/torchgeo/PYSEC-2024-204.yaml web
- https://github.com/torchgeo/torchgeo package
- https://msrc.microsoft.com/update-guide/vulnerability/CVE-2024-49048 web