# Fix to make torch.load safer in Pytorch v2.1.2

**URL:** <https://dev-discuss.pytorch.org/t/fix-to-make-torch-load-safer-in-pytorch-v2-1-2/2992>\
**Category:** Uncategorized\
**Created:** [May 13, 2025, 5:16am UTC](https://dev-discuss.pytorch.org/t/fix-to-make-torch-load-safer-in-pytorch-v2-1-2/2992 "2025-05-13T05:16:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aman-Surkar](https://yyz2.discourse-cdn.com/flex036/user_avatar/dev-discuss.pytorch.org/aman-surkar/32/2727_2.png) [@Aman-Surkar](https://dev-discuss.pytorch.org/u/Aman-Surkar)\
**Post date:** [May 13, 2025, 5:16am UTC](https://dev-discuss.pytorch.org/t/fix-to-make-torch-load-safer-in-pytorch-v2-1-2/2992/1 "2025-05-13T05:16:57Z")

</div>

I am trying to fix [CVE-2025-32434](https://nvd.nist.gov/vuln/detail/CVE-2025-32434) in Pytorch v2.1.2, as I won’t be able to upgrade Pytorch to v2.6.0. I tried backporting PRs ([#137602](https://github.com/pytorch/pytorch/pull/137602), [#138225](https://github.com/pytorch/pytorch/pull/138225), [#138866](https://github.com/pytorch/pytorch/pull/138866), [#139221](https://github.com/pytorch/pytorch/pull/139221), [#140304](https://github.com/pytorch/pytorch/pull/140304), [#138936](https://github.com/pytorch/pytorch/pull/138936), [#139541](https://github.com/pytorch/pytorch/pull/139541), [#140738](https://github.com/pytorch/pytorch/pull/140738), [#142153](https://github.com/pytorch/pytorch/pull/142153), [#139433](https://github.com/pytorch/pytorch/pull/139433)) mentioned in Release Notes of Pytorch v2.6.0 in Pytorch v2.1.2. I am seeing a series of errors when I try running test/test\_serialization.py file. I wanted to know the ideal way is of fixing this CVE in Pytorch v2.1.2, to make torch.load safe.

---

<div class="post-metadata">

**Author:** ![albanD](https://yyz2.discourse-cdn.com/flex036/user_avatar/dev-discuss.pytorch.org/alband/32/9_2.png) [@albanD](https://dev-discuss.pytorch.org/u/albanD)\
**Post date:** [May 21, 2025, 8:57pm UTC](https://dev-discuss.pytorch.org/t/fix-to-make-torch-load-safer-in-pytorch-v2-1-2/2992/2 "2025-05-21T20:57:46Z")

</div>

Hey!

Given how old your version of PyTorch is, I don’t expect a backport really make sense.  
The bottom line is that this CVE only matters if you load untrusted model from the wild. As long as you don’t do that (which you shouldn’t do in general!!), this CVE doesn’t apply.
