Add OSS-Fuzz harness for JSON tensor REST API parser - #4143
Open
rishuranjanofficial wants to merge 1 commit into
Open
Add OSS-Fuzz harness for JSON tensor REST API parser#4143rishuranjanofficial wants to merge 1 commit into
rishuranjanofficial wants to merge 1 commit into
Conversation
Adds a libFuzzer harness covering the three HTTP REST API JSON parsing entry points in json_tensor.cc: - FillPredictRequestFromJson (/v1/models/*:predict) - FillClassificationRequestFromJson (/v1/models/*:classify) - FillRegressionRequestFromJson (/v1/models/*:regress) CVE-2025-0649 (uncontrolled recursion, stack overflow DoS) was found in this path. This harness enables continuous fuzzing via OSS-Fuzz to catch future regressions.
Author
|
Happy to add a json_tensor_fuzzer_seed_corpus.zip with representative JSON payloads for each endpoint if that would help reviewers or the OSS-Fuzz integration. Let me know. |
rishuranjanofficial
added a commit
to rishuranjanofficial/oss-fuzz
that referenced
this pull request
Aug 3, 2026
Adds continuous fuzzing for the TensorFlow Serving JSON tensor parser, which processes untrusted HTTP request bodies for the REST API (/v1/models/:predict, :classify, :regress). Fuzzer targets: - FillPredictRequestFromJson (DT_FLOAT, DT_STRING, DT_INT64 inputs) - FillClassificationRequestFromJson - FillRegressionRequestFromJson CVE-2025-0649 (uncontrolled recursion in GetDenseTensorShape / FillTensorProto) was found in this exact code path. This harness provides regression coverage and enables detection of future parser vulnerabilities. Companion fix PR: tensorflow/serving#4143
Author
|
I've submitted this pull request and would appreciate a review when you have some bandwidth. Please let me know if any changes or additional context are needed. Thank you for your time and consideration. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds a libFuzzer fuzz harness targeting the JSON tensor parsing
layer in
tensorflow_serving/util/json_tensor.cc, which processesuntrusted HTTP request bodies for the TF Serving REST API.
What's fuzzed
POST /v1/models/*:predictFillPredictRequestFromJsonPOST /v1/models/*:classifyFillClassificationRequestFromJsonPOST /v1/models/*:regressFillRegressionRequestFromJsonThree tensor dtype variants are covered per endpoint (float, string/b64,
int64) to exercise different parsing branches including the base64 decode
path and the recursive shape inference path.
Security motivation
CVE-2025-0649 (uncontrolled recursion in
GetDenseTensorShapeandFillTensorProto, CVSS 7.5 HIGH) was found in this exact code path.The vulnerability allows an unauthenticated attacker to crash the
serving process with a single ~100 KB HTTP request.
Continuous fuzzing via OSS-Fuzz will:
caught before they reach users
Files changed
tensorflow_serving/util/json_tensor_fuzzer.cc— libFuzzer entry pointtensorflow_serving/util/BUILD— Bazel build target for the fuzzerRelated