Skip to content

Commit a6e80da

Browse files
LoCoBench Botclaude
andcommitted
feat: US-008 - Create sec-transitive-002: Transitive dependency vulnerability (NOT affected)
Created security triage task for transitive dependency analysis where the consuming project is NOT affected despite having a vulnerable library. Task details: - grpcurl v1.8.7 (gRPC CLI client tool) - CVE-2023-39325 in golang.org/x/net v0.14.0 (HTTP/2 rapid reset DoS) - Dependency chain: grpcurl → grpc-go v1.56.2 → x/net v0.14.0 (vulnerable) - Assessment: NOT AFFECTED (uses HTTP/2 client, not server) Key insight: CVE-2023-39325 affects http2.Server.ServeConn (server-side). grpcurl only uses http2.Transport (client-side) to make gRPC calls to remote servers. This is a common false positive in dependency scanning. Paired with sec-transitive-001 (AFFECTED case) for calibration. Harder than AFFECTED case - agent must prove a negative by distinguishing client vs server code paths. Files created: - benchmarks/ccb_security/sec-transitive-002/task.toml - benchmarks/ccb_security/sec-transitive-002/instruction.md - benchmarks/ccb_security/sec-transitive-002/environment/Dockerfile - benchmarks/ccb_security/sec-transitive-002/tests/ground_truth.json - benchmarks/ccb_security/sec-transitive-002/tests/test.sh - benchmarks/ccb_security/sec-transitive-002/tests/expected_patches/README.md Files modified: - configs/security_2config.sh (added task to ALL_TASK_IDS, TASK_SG_REPO_NAMES) - configs/selected_benchmark_tasks.json (registered task, updated statistics) - ralph-gapfill-security/prd.json (marked US-008 as complete) - ralph-gapfill-security/progress.txt (documented implementation) Completes ccb_security suite: 8 tasks total (3 CVE, 3 reachability, 2 transitive) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 7a452b4 commit a6e80da

File tree

10 files changed

+567
-6
lines changed

10 files changed

+567
-6
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
FROM golang:1.20-bookworm
2+
3+
# Install dependencies for verifier (jq and bc for weighted checklist scoring)
4+
RUN apt-get update && apt-get install -y jq bc git && rm -rf /var/lib/apt/lists/*
5+
6+
WORKDIR /workspace
7+
8+
# Clone grpcurl at v1.8.7 (the consuming project)
9+
# Commit: 25c896aa59ffc36f7d12cf5d6c18e9c8f4421bfa
10+
RUN git clone https://github.com/fullstorydev/grpcurl.git grpcurl && \
11+
cd grpcurl && \
12+
git checkout 25c896aa59ffc36f7d12cf5d6c18e9c8f4421bfa && \
13+
git log -1 --format="%H %s" | head -1 | grep -q "25c896a"
14+
15+
# Clone grpc-go at v1.56.2 (the intermediate dependency)
16+
# This version uses golang.org/x/net v0.14.0 (vulnerable to CVE-2023-39325)
17+
RUN git clone https://github.com/grpc/grpc-go.git grpc-go && \
18+
cd grpc-go && \
19+
git checkout v1.56.2 && \
20+
git log -1 --format="%H %s" | head -1 | grep -q "v1.56.2"
21+
22+
# Clone golang.org/x/net at v0.14.0 (VULNERABLE version)
23+
# This version is before v0.17.0 which fixed CVE-2023-39325
24+
RUN git clone https://go.googlesource.com/net && \
25+
cd net && \
26+
git checkout v0.14.0 && \
27+
git describe --tags | grep -q "v0.14.0"
28+
29+
# Verify the vulnerability exists in x/net v0.14.0
30+
# CVE-2023-39325 was fixed in v0.17.0 with addition of scheduleHandler() and handler throttling
31+
# In v0.14.0, processHeaders() directly spawns handlers without limit enforcement
32+
RUN cd net && \
33+
grep -q "func (sc \*serverConn) processHeaders" http2/server.go && \
34+
! grep -q "scheduleHandler" http2/server.go && \
35+
echo "Confirmed: x/net v0.14.0 is VULNERABLE to CVE-2023-39325 (no scheduleHandler throttling)"
36+
37+
# Create logs directory for agent output
38+
RUN mkdir -p /logs/agent
39+
40+
# Display dependency information
41+
RUN echo "===== Repository Versions =====" && \
42+
echo "grpcurl: v1.8.7 (25c896a)" && \
43+
cd grpcurl && git log -1 --oneline && \
44+
echo "" && \
45+
echo "grpc-go: v1.56.2" && \
46+
cd /workspace/grpc-go && git log -1 --oneline && \
47+
echo "" && \
48+
echo "golang.org/x/net: v0.14.0 (VULNERABLE)" && \
49+
cd /workspace/net && git log -1 --oneline
50+
51+
WORKDIR /workspace
Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
# Security Triage: Transitive Dependency Vulnerability Assessment
2+
3+
## Objective
4+
5+
You are a security analyst reviewing a potential vulnerability in a Go project. Your task is to determine if the project is affected by a vulnerability in a transitive dependency and document the complete import chain.
6+
7+
## Context
8+
9+
**Project**: `fullstorydev/grpcurl` (v1.8.7) - A command-line tool for interacting with gRPC servers (like cURL, but for gRPC)
10+
11+
**Vulnerability**: CVE-2023-39325 in `golang.org/x/net/http2`
12+
13+
**CVE Summary**:
14+
- **Severity**: High (CVSS 7.5)
15+
- **Type**: Denial of Service via HTTP/2 Rapid Reset
16+
- **Package**: `golang.org/x/net/http2`
17+
- **Affected versions**: < v0.17.0
18+
- **Fixed in**: v0.17.0 (October 2023)
19+
- **Description**: A malicious HTTP/2 client which rapidly creates requests and immediately resets them can cause excessive server resource consumption. While the total number of requests is bounded by `http2.Server.MaxConcurrentStreams`, resetting an in-progress request allows the attacker to create a new request while the existing one is still executing. This vulnerability specifically affects HTTP/2 **server** implementations that use `golang.org/x/net/http2.Server.ServeConn`.
20+
21+
## The Dependency Chain
22+
23+
The `fullstorydev/grpcurl` project has the following dependency structure:
24+
25+
```
26+
fullstorydev/grpcurl v1.8.7
27+
└── google.golang.org/grpc v1.56.2
28+
└── golang.org/x/net v0.14.0 (August 2023, VULNERABLE)
29+
```
30+
31+
## Vulnerability Scope
32+
33+
**Vulnerable Symbol**: `golang.org/x/net/http2.Server.ServeConn`
34+
35+
**Important Context**: CVE-2023-39325 affects HTTP/2 **SERVER** implementations. It does **NOT** affect HTTP/2 **clients**. The vulnerability is triggered when a malicious client connects to an HTTP/2 server and sends rapid RST_STREAM frames.
36+
37+
## Repositories Available
38+
39+
You have access to three Git repositories in `/workspace`:
40+
41+
1. **grpcurl/** - The consuming project (`github.com/fullstorydev/grpcurl` at v1.8.7)
42+
2. **grpc-go/** - The intermediate dependency (`google.golang.org/grpc` at v1.56.2)
43+
3. **net/** - The vulnerable library (`golang.org/x/net` at v0.14.0, VULNERABLE version)
44+
45+
## Your Task
46+
47+
Analyze the code and provide a security triage report answering these questions:
48+
49+
1. **Is grpcurl affected by CVE-2023-39325?**
50+
- Does grpcurl use `google.golang.org/grpc`?
51+
- Does `grpc-go` use `golang.org/x/net/http2`?
52+
- Does grpcurl actually call the vulnerable code path (`http2.Server.ServeConn`)?
53+
- Or does it only use HTTP/2 **client** functionality?
54+
55+
2. **What is the complete import chain?**
56+
- Trace the dependency from grpcurl → grpc-go → golang.org/x/net
57+
- Identify the specific files and functions in grpcurl that use gRPC
58+
- Identify how grpc-go uses `golang.org/x/net/http2`
59+
- Determine if grpc-go uses `http2.Server` (server) or `http2.Transport` (client)
60+
61+
3. **What is the actual usage pattern?**
62+
- Is grpcurl a **client** tool or a **server**?
63+
- Does grpcurl run an HTTP/2 server, or does it only make HTTP/2 client requests?
64+
- Are there any server-side HTTP/2 code paths in grpcurl or grpc-go that would expose the vulnerability?
65+
66+
4. **Assessment**
67+
- Is the project affected? (YES/NO)
68+
- What is the risk level? (CRITICAL/HIGH/MEDIUM/LOW/NONE)
69+
- Why is it affected or not affected?
70+
71+
## Output Format
72+
73+
Write your analysis to `/logs/agent/triage.md` with the following sections:
74+
75+
```markdown
76+
# CVE-2023-39325 Transitive Dependency Analysis
77+
78+
## Summary
79+
[Brief summary: Is grpcurl affected? What's the verdict?]
80+
81+
## Dependency Chain Analysis
82+
83+
### Direct Dependency: grpcurl → grpc-go
84+
[Evidence from grpcurl's go.mod and code that imports/uses grpc-go]
85+
86+
### Transitive Dependency: grpc-go → golang.org/x/net
87+
[Evidence from grpc-go's go.mod and code that uses golang.org/x/net/http2]
88+
89+
### Vulnerable Code Usage Analysis
90+
[Evidence of whether http2.Server.ServeConn or http2.Transport (client) is used]
91+
92+
## Code Path Trace
93+
94+
### Entry Point in grpcurl
95+
[File and function in grpcurl that makes gRPC calls]
96+
97+
### gRPC Client in grpc-go
98+
[How grpc-go implements gRPC client calls using HTTP/2]
99+
100+
### HTTP/2 Transport in golang.org/x/net
101+
[Which HTTP/2 components are actually used: Server or Transport (client)?]
102+
103+
## Server vs Client Analysis
104+
105+
**grpcurl Purpose**: [Is it a client tool or server tool?]
106+
107+
**HTTP/2 Server Usage**: [Does grpcurl or grpc-go run an HTTP/2 server?]
108+
109+
**HTTP/2 Client Usage**: [Does grpcurl use HTTP/2 client to connect to gRPC servers?]
110+
111+
**Vulnerable Function Path**: [Is http2.Server.ServeConn called anywhere in the stack?]
112+
113+
## Impact Assessment
114+
115+
**Affected**: [YES/NO]
116+
117+
**Risk Level**: [CRITICAL/HIGH/MEDIUM/LOW/NONE]
118+
119+
**Rationale**: [Explain why the project is or is not affected based on client vs server usage]
120+
121+
**Exploitability**: [Can an attacker trigger CVE-2023-39325 against grpcurl?]
122+
123+
## Remediation
124+
125+
[Recommended actions: upgrade, accept risk, or no action needed]
126+
```
127+
128+
## Important Notes
129+
130+
- This is an **analysis-only** task. Do NOT modify any code.
131+
- Provide specific file paths, line numbers, and code snippets as evidence.
132+
- The vulnerability is in a **transitive** dependency (grpcurl → grpc-go → x/net).
133+
- Pay close attention to **client vs server** distinction: CVE-2023-39325 only affects **servers**.
134+
- grpcurl is a **command-line tool** - think about what that means for server vs client usage.
135+
- A project can have a vulnerable library in its dependency tree but still be NOT affected if it doesn't use the vulnerable code path.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[task]
2+
id = "sec-transitive-002"
3+
description = "Transitive dependency vulnerability analysis: grpcurl with CVE-2023-39325 (NOT affected)"
4+
category = "transitive_dependency"
5+
language = "go"
6+
time_limit_sec = 1200
7+
8+
[metadata]
9+
difficulty = "hard"
10+
tags = ["security", "cve", "dependency-analysis", "http2", "client-only", "false-positive"]
11+
12+
[environment]
13+
# Build from Dockerfile in environment/ subdirectory
14+
type = "dockerfile"
15+
path = "environment"
16+
17+
[outputs]
18+
# Agent writes triage report to /logs/agent/triage.md
19+
required = ["/logs/agent/triage.md"]
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Expected Patches
2+
3+
This is an **analysis-only** task. The agent should NOT modify any code.
4+
5+
The expected output is a security triage report at `/logs/agent/triage.md` that correctly identifies that grpcurl is **NOT affected** by CVE-2023-39325 despite having a vulnerable version of golang.org/x/net in its dependency tree.
6+
7+
## Why NOT Affected?
8+
9+
CVE-2023-39325 affects HTTP/2 **servers** (specifically `golang.org/x/net/http2.Server.ServeConn`).
10+
11+
grpcurl is a **client-only** tool that uses HTTP/2 **Transport** (client-side) to make gRPC calls to remote servers. It never runs an HTTP/2 server, so the vulnerable code path is never executed.
12+
13+
This is a common false positive scenario in dependency scanning tools.
Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
{
2+
"required_findings": [
3+
{
4+
"id": "finding_1",
5+
"description": "Correctly identify that grpcurl is a CLIENT tool, not a server",
6+
"patterns": ["grpcurl.*client", "command-line tool", "client.*grpc", "not.*server"],
7+
"weight": 0.15
8+
},
9+
{
10+
"id": "finding_2",
11+
"description": "Identify that CVE-2023-39325 affects HTTP/2 SERVER only (http2.Server.ServeConn)",
12+
"patterns": ["server.*only", "http2\\.Server", "ServeConn", "server-side", "server.*vulnerable"],
13+
"weight": 0.15
14+
},
15+
{
16+
"id": "finding_3",
17+
"description": "Identify that grpc-go uses HTTP/2 TRANSPORT (client) not SERVER",
18+
"patterns": ["http2\\.Transport", "client.*transport", "dial", "NewClient", "clientconn"],
19+
"weight": 0.15
20+
},
21+
{
22+
"id": "finding_4",
23+
"description": "Confirm the dependency chain: grpcurl → grpc-go → golang.org/x/net",
24+
"patterns": ["grpcurl.*grpc-go", "grpc.*x/net", "google\\.golang\\.org/grpc", "golang\\.org/x/net"],
25+
"weight": 0.10
26+
},
27+
{
28+
"id": "finding_5",
29+
"description": "Correctly assess as NOT AFFECTED despite having vulnerable library",
30+
"patterns": ["not.*affected", "NOT AFFECTED", "not vulnerable", "false positive", "not exploitable"],
31+
"weight": 0.20
32+
},
33+
{
34+
"id": "finding_6",
35+
"description": "Explain that the vulnerable code path (http2.Server) is never called",
36+
"patterns": ["never.*server", "doesn't.*use.*Server", "only.*client", "no.*server.*code", "client.*only"],
37+
"weight": 0.15
38+
},
39+
{
40+
"id": "finding_7",
41+
"description": "Risk level assessment: LOW or NONE (not CRITICAL/HIGH)",
42+
"patterns": ["risk.*low", "risk.*none", "risk.*minimal", "no.*risk"],
43+
"weight": 0.10
44+
}
45+
],
46+
"file_references": [
47+
{
48+
"id": "file_ref_1",
49+
"description": "Reference to grpcurl main.go or invoke.go (the entry point that makes gRPC calls)",
50+
"patterns": ["grpcurl.*main\\.go", "grpcurl.*invoke\\.go", "cmd/grpcurl"],
51+
"weight": 0.30
52+
},
53+
{
54+
"id": "file_ref_2",
55+
"description": "Reference to grpc-go clientconn.go or transport (HTTP/2 client usage)",
56+
"patterns": ["grpc.*clientconn", "grpc.*transport", "internal/transport", "grpc.*dial"],
57+
"weight": 0.35
58+
},
59+
{
60+
"id": "file_ref_3",
61+
"description": "Reference to golang.org/x/net/http2 (Transport or client-side components)",
62+
"patterns": ["x/net/http2", "net/http2.*transport", "http2.*client"],
63+
"weight": 0.35
64+
}
65+
],
66+
"causal_chain": [
67+
{
68+
"id": "chain_1",
69+
"description": "Entry point: grpcurl CLI invokes gRPC client calls",
70+
"patterns": ["grpcurl.*invoke", "main.*grpc", "InvokeRPC", "grpcurl.*dial"],
71+
"weight": 0.15
72+
},
73+
{
74+
"id": "chain_2",
75+
"description": "grpc-go creates client connection (Dial/DialContext)",
76+
"patterns": ["grpc\\.Dial", "grpc\\.DialContext", "NewClient.*Conn", "clientconn"],
77+
"weight": 0.20
78+
},
79+
{
80+
"id": "chain_3",
81+
"description": "grpc-go uses HTTP/2 Transport for client-side HTTP/2",
82+
"patterns": ["http2\\.Transport", "newHTTP2Client", "http2Client\\.Do", "transport.*dial"],
83+
"weight": 0.25
84+
},
85+
{
86+
"id": "chain_4",
87+
"description": "golang.org/x/net/http2.Transport is used (CLIENT side)",
88+
"patterns": ["http2\\.Transport", "Transport\\.RoundTrip", "ConfigureTransport", "client.*http2"],
89+
"weight": 0.20
90+
},
91+
{
92+
"id": "chain_5",
93+
"description": "Confirm that http2.Server.ServeConn is NEVER called (server-side code path not used)",
94+
"patterns": ["no.*ServeConn", "never.*Server", "not.*server.*code", "client.*only", "no.*server.*path"],
95+
"weight": 0.20
96+
}
97+
],
98+
"negative_checks": [
99+
{
100+
"id": "negative_1",
101+
"description": "Must NOT claim grpcurl is affected or vulnerable",
102+
"patterns": ["grpcurl.*affected", "grpcurl.*vulnerable", "grpcurl.*exploitable", "affected.*yes"],
103+
"must_be_absent": true,
104+
"weight": 0.30
105+
},
106+
{
107+
"id": "negative_2",
108+
"description": "Must NOT claim the vulnerability is CRITICAL or HIGH risk for grpcurl",
109+
"patterns": ["risk.*critical", "risk.*high", "severity.*critical", "severity.*high"],
110+
"must_be_absent": true,
111+
"weight": 0.25
112+
},
113+
{
114+
"id": "negative_3",
115+
"description": "Must NOT recommend urgent patching (since project is not affected)",
116+
"patterns": ["immediately.*upgrade", "urgent.*patch", "critical.*update", "must.*upgrade"],
117+
"must_be_absent": true,
118+
"weight": 0.20
119+
},
120+
{
121+
"id": "negative_4",
122+
"description": "Must NOT confuse client and server (e.g., claiming grpcurl runs an HTTP/2 server)",
123+
"patterns": ["grpcurl.*server", "grpcurl.*ServeConn", "grpcurl.*listens", "grpcurl.*accepts.*connections"],
124+
"must_be_absent": true,
125+
"weight": 0.25
126+
}
127+
],
128+
"weights": {
129+
"required_findings": 0.40,
130+
"file_references": 0.20,
131+
"causal_chain": 0.25,
132+
"negative_checks": 0.15
133+
}
134+
}

0 commit comments

Comments
 (0)