Skip to content

Commit 7c6a40e

Browse files
1 parent acc7e18 commit 7c6a40e

File tree

2 files changed

+115
-0
lines changed

2 files changed

+115
-0
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
{
2+
"schema_version": "1.4.0",
3+
"id": "GHSA-3jfp-46x4-xgfj",
4+
"modified": "2026-04-17T22:21:03Z",
5+
"published": "2026-04-17T22:21:03Z",
6+
"aliases": [],
7+
"summary": "yard: Possible arbitrary path traversal and file access via yard server",
8+
"details": "### Impact\n\nA path traversal vulnerability was discovered in YARD <= 0.9.41 when using yard server to serve documentation. This bug would allow unsanitized HTTP requests to access arbitrary files on the machine of a yard server host under certain conditions.\n\nThe original patch in [GHSA-xfhh-rx56-rxcr](https://github.com/lsegal/yard/security/advisories/GHSA-xfhh-rx56-rxcr) was incorrectly applied.\n\n### Patches\n\nPlease upgrade to YARD v0.9.42 immediately if you are relying on yard server to host documentation in any untrusted environments without WEBrick and rely on `--docroot`.\n\n### Workarounds\n\nFor users who cannot upgrade, it is possible to perform path sanitization of HTTP requests at your webserver level. WEBrick, for example, can perform such sanitization by default (which you can use via yard server -s webrick), as can certain rules in your webserver configuration.",
9+
"severity": [
10+
{
11+
"type": "CVSS_V4",
12+
"score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N"
13+
}
14+
],
15+
"affected": [
16+
{
17+
"package": {
18+
"ecosystem": "RubyGems",
19+
"name": "yard"
20+
},
21+
"ranges": [
22+
{
23+
"type": "ECOSYSTEM",
24+
"events": [
25+
{
26+
"introduced": "0"
27+
},
28+
{
29+
"fixed": "0.9.42"
30+
}
31+
]
32+
}
33+
]
34+
}
35+
],
36+
"references": [
37+
{
38+
"type": "WEB",
39+
"url": "https://github.com/lsegal/yard/security/advisories/GHSA-3jfp-46x4-xgfj"
40+
},
41+
{
42+
"type": "PACKAGE",
43+
"url": "https://github.com/lsegal/yard"
44+
}
45+
],
46+
"database_specific": {
47+
"cwe_ids": [
48+
"CWE-22"
49+
],
50+
"severity": "MODERATE",
51+
"github_reviewed": true,
52+
"github_reviewed_at": "2026-04-17T22:21:03Z",
53+
"nvd_published_at": null
54+
}
55+
}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
{
2+
"schema_version": "1.4.0",
3+
"id": "GHSA-8gmg-3w2q-65f4",
4+
"modified": "2026-04-17T22:21:41Z",
5+
"published": "2026-04-17T22:21:41Z",
6+
"aliases": [],
7+
"summary": "OpenTelemetry eBPF Instrumentation: Privileged Java agent injection allows arbitrary host file overwrite via untrusted TMPDIR",
8+
"details": "### Summary\n\nA flaw in the Java agent injection path allows a local attacker controlling a Java workload to overwrite arbitrary host files when Java injection is enabled and OBI is running with elevated privileges. The injector trusted `TMPDIR` from the target process and used unsafe file creation semantics, enabling both filesystem boundary escape and symlink-based file clobbering.\n\n### Remediation\n\nUpgrade to https://github.com/open-telemetry/opentelemetry-ebpf-instrumentation/releases/tag/v0.8.0.\n\n### Details\n\nThe issue is in the Java agent staging logic in `pkg/internal/java/java_inject.go`.\n\nThe injector reads `TMPDIR` from the target process environment in `findTempDir(...)` and validates it with `dirOK(...)`. In the vulnerable implementation, `dirOK(...)` used `filepath.Join(root, dir)`, where `root` is `/proc/<pid>/root`. If `dir` is an absolute path, `filepath.Join` discards `root`, so values such as `/etc` or `/proc/1/root/etc` are resolved on the host instead of within the target process root.\n\nThat validated value is later reused in `copyAgent(...)` to build the destination path for the Java agent JAR. As a result, a malicious process can influence the privileged injector to write outside the intended `/proc/<pid>/root` boundary.\n\nThe file creation step further increases impact. The vulnerable code created the destination with `os.OpenFile(..., os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0o644)`. Because this does not use exclusive creation or symlink protections, an attacker can pre-create a symlink at the chosen destination, for example in a writable temp directory, and cause the injector to truncate or overwrite another file writable by the privileged OBI process.\n\nRelevant code paths:\n\n- `pkg/internal/java/java_inject.go`: `findTempDir(...)`\n- `pkg/internal/java/java_inject.go`: `dirOK(...)`\n- `pkg/internal/java/java_inject.go`: `copyAgent(...)`\n\nIn short, the vulnerability is caused by two issues acting together:\n\n1. Untrusted `TMPDIR` from the target process can escape the intended target root.\n2. The destination JAR is written with unsafe open semantics that allow clobbering via symlink or attacker-controlled destination selection.\n\n### PoC\n\nPrerequisites:\n\n- OBI is running with elevated privileges on the host.\n- Java injection is enabled.\n- The attacker can run or control a Java process on the same host.\n\nReproduction outline for the path escape case:\n\n1. Start a Java process with a controlled environment variable such as:\n - `TMPDIR=/etc`\n - or `TMPDIR=/proc/1/root/etc`\n2. Ensure the process is discovered by OBI and selected for Java agent injection.\n3. Wait for the injector to stage the agent JAR.\n4. Observe that the injector attempts to write `obi-java-agent.jar` outside `/proc/<pid>/root`, under the attacker-controlled host path.\n\nReproduction outline for the symlink clobber case:\n\n1. Start a Java process with `TMPDIR=/tmp` or another writable temp directory.\n2. Before injection occurs, create a symlink at the expected destination:\n - `/tmp/obi-java-agent.jar -> /path/to/target/file`\n3. Trigger Java agent injection for that process.\n4. Observe that the privileged injector opens the symlink target with truncate semantics and overwrites the linked file contents.\n\nCode evidence:\n\n- `findTempDir(...)` reads `ie.FileInfo.Service.EnvVars[\"TMPDIR\"]`\n- `dirOK(...)` validates using `filepath.Join(root, dir)`\n- `copyAgent(...)` writes the JAR into the selected temp directory\n- the vulnerable write uses `os.OpenFile(..., os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0o644)`\n\n### Impact\n\nThis is an arbitrary file overwrite / file clobber vulnerability in a privileged host component.\n\nAffected users are deployments where:\n\n- Java injection is enabled\n- OBI runs with elevated privileges\n- untrusted local workloads can run Java processes on the same host\n\nAn attacker who can control a local Java process may be able to overwrite host files writable by OBI, which can lead to:\n\n- host integrity compromise\n- service disruption or denial of service\n- possible local privilege escalation depending on deployment details and overwritten targets\n\nThe issue is local rather than remote, but the impact is high because the vulnerable component operates with elevated privileges on the host.",
9+
"severity": [
10+
{
11+
"type": "CVSS_V3",
12+
"score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:N/I:H/A:H"
13+
}
14+
],
15+
"affected": [
16+
{
17+
"package": {
18+
"ecosystem": "Go",
19+
"name": "go.opentelemetry.io/obi"
20+
},
21+
"ranges": [
22+
{
23+
"type": "ECOSYSTEM",
24+
"events": [
25+
{
26+
"introduced": "0.4.0"
27+
},
28+
{
29+
"fixed": "0.8.0"
30+
}
31+
]
32+
}
33+
]
34+
}
35+
],
36+
"references": [
37+
{
38+
"type": "WEB",
39+
"url": "https://github.com/open-telemetry/opentelemetry-ebpf-instrumentation/security/advisories/GHSA-8gmg-3w2q-65f4"
40+
},
41+
{
42+
"type": "PACKAGE",
43+
"url": "https://github.com/open-telemetry/opentelemetry-ebpf-instrumentation"
44+
},
45+
{
46+
"type": "WEB",
47+
"url": "https://github.com/open-telemetry/opentelemetry-ebpf-instrumentation/releases/tag/v0.8.0"
48+
}
49+
],
50+
"database_specific": {
51+
"cwe_ids": [
52+
"CWE-22",
53+
"CWE-59"
54+
],
55+
"severity": "HIGH",
56+
"github_reviewed": true,
57+
"github_reviewed_at": "2026-04-17T22:21:41Z",
58+
"nvd_published_at": null
59+
}
60+
}

0 commit comments

Comments
 (0)