Skip to content

Fix/ghsa vw7q websocket json depth - #632

Merged
wsobel merged 4 commits into
mainfrom
fix/ghsa-vw7q-websocket-json-depth
Dec 4, 2026
Merged

wsobel merged 4 commits into
mainfrom
fix/ghsa-vw7q-websocket-json-depth

Conversation

@wsobel

@wsobel wsobel commented Dec 1, 2026

Copy link
Copy Markdown
Member

This PR addresses https://github.com/mtconnect/cppagent/security/advisories/GHSA-vw7q-qc2r-cf92

Every text message that arrives on a WebSocket connection is parsed with RapidJSON's default parser, which is recursive: it calls itself once for every level of nesting. The agent sets no limit on nesting. A message that consists of about 175,000 or more opening square brackets uses up the 8 MiB stack of the worker thread, and the agent process ends with a segmentation fault.

wsobel and others added 3 commits November 27, 2026 16:22
jiro4989/build-deb-action runs a prebuilt amd64-only Docker image, which
fails on the ubuntu-22.04-arm runner with a platform mismatch. Generate the
DEBIAN/control file and call dpkg-deb directly instead; the step still
exposes file_name for the release upload.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…bSocket JSON

Parse WebSocket requests with RapidJSON's iterative parser so nesting depth
no longer consumes worker-thread stack; a ~200 kB message of '[' could crash
the agent. Apply the same flag to the entity and device JSON parsers.

Also validate array parameters in WebSocket requests: non-string elements
were read with GetString() and could segfault, and an empty array threw
instead of producing an empty value.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@wsobel
wsobel requested a review from simonyg December 3, 2026 11:38
@wsobel
wsobel merged commit e207e99 into main Dec 4, 2026
15 checks passed
@wsobel
wsobel deleted the fix/ghsa-vw7q-websocket-json-depth branch December 4, 2026 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants