Advisory

GHSA-ghq9-vc6f-8qjf

Also known as: CVE-2024-49048, PYSEC-2024-204

Summary

TorchGeo Remote Code Execution Vulnerability

Details

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

Severity

High Basis: The source's own band: HIGH

Dates

Published
2026-04-01 00:03 UTC
Modified
2026-04-01 00:26 UTC

Affected packages and fixes

torchgeo

PyPI · All systems

Affected

  • introduced 0.4, fixed 0.6.1 (ecosystem)

Fixed versions

0.6.1

Fix

  • Fixed version 0.6.1
    pip install --upgrade torchgeo==0.6.1

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences