/

CVE-2025-71007

Severity:

HIGH RISK

(7.5)

Improper Input Validation in OneFlow index_add Leads to

CVE-2025-71007

Analyzed

Vulnerability type

Category:

Improper Input Validation

CWE:

CWE-20

Impact:

Denial of Service

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

An improper input validation flaw in the oneflow.index_add component of OneFlow v0.9.0 allows crafted inputs to trigger abnormal behavior and resource exhaustion.

Under specific malformed or boundary-breaking tensor inputs, an attacker can cause the process using OneFlow to crash or hang, resulting in a Denial of Service (DoS).

Affected context

This vulnerability appears in environments using OneFlow v0.9.0 where the oneflow.index_add operation is exposed to data that is not strictly controlled or validated.

It is most relevant for applications that:

  • Accept or process user-controlled or externally sourced tensor indices and values
  • Perform dynamic index-based tensor updates at runtime
  • Run long-lived services (e.g., model serving, APIs, or pipelines) that rely on continuous availability

The issue is less likely to manifest when all inputs are fully constrained by internal logic and validated before being passed into index_add.

Exploit preconditions

  • Attack surface: Any API, service, or job that calls oneflow.index_add with data influenced by an external party.
  • Required access: Ability to supply or shape tensor inputs (indices and/or update values) reaching the vulnerable operation. This may occur via HTTP APIs, message queues, batch jobs, or shared data stores.
  • Trigger point: Invocation of oneflow.index_add with a specially crafted input that violates assumed invariants (e.g., malformed shape, inconsistent index ranges, or edge-case values).
  • Why exploitation is possible: The function does not sufficiently validate or sanitize inputs before performing internal operations, allowing unexpected states that can lead to crashes, assertion failures, or excessive resource consumption.

Why this happens

The root cause aligns with CWE-20: Improper Input Validation.

The oneflow.index_add operation relies on assumptions about its inputs—such as valid index ranges, compatible tensor shapes, and well-formed parameters—without robustly checking them.

When crafted or malformed inputs bypass these assumptions, internal logic can encounter invalid memory access patterns, excessive looping, or runtime exceptions.

Instead of gracefully rejecting bad input with controlled error handling, the component enters a failure state, causing the calling process or worker to terminate or become unresponsive.

Potential impact

  • Application or service crashes when processing attacker-controlled inputs
  • Temporary unavailability of model-serving endpoints or data-processing jobs
  • Disruption of workflows relying on OneFlow operations, potentially causing job failures or retries
  • Consumption of CPU or memory resources leading to degraded performance for co-located services

General mitigation guidance

Effective mitigation focuses on enforcing strict input discipline at the boundaries of the system and around calls to index_add:

  • Validate tensor shapes, dtypes, and index ranges before invoking oneflow.index_add, rejecting or normalizing unexpected values.
  • Introduce explicit checks for size limits and resource usage to avoid overly large or pathological inputs.
  • Prefer defensive programming patterns where lower-level tensor operations fail fast with clear errors for invalid arguments.
  • Isolate untrusted data processing into constrained worker processes or containers so that a crash does not affect the entire system.
  • Apply least-privilege principles and resource quotas at the runtime level (e.g., container limits) so that a DoS in one component does not cascade to the whole deployment.

How teams detect issues like this

Detection generally combines runtime monitoring with targeted code inspection:

  • Instrument services using OneFlow to log input characteristics and capture crashes or timeouts associated with index_add calls.
  • Monitor for patterns of repeated failures, abnormal termination, or spike in resource usage when specific input sizes or shapes are processed.
  • Use static analysis and code review checklists to identify direct calls to oneflow.index_add that lack explicit input validation or bounds checks.
  • Apply automated testing and fuzzing to tensor operations, feeding edge-case and adversarial inputs to uncover similar robustness issues.
  • Integrate CI pipelines with automated review tools that flag critical tensor operations used with user-controlled data but without validation.

Sources

SourceLink
github.comgithub.com/Daisy2ang
github.comgithub.com/Oneflow-Inc/oneflow/issues/10652

Frequently asked

questions

It can be remotely exploitable if the application exposes an API or interface where remote users can influence the tensors passed to oneflow.index_add. In purely offline or tightly controlled pipelines, the practical exploitability is more limited.

An attacker needs the ability to supply or control the inputs (indices and/or tensors) that reach the vulnerable function. This might be as simple as sending crafted requests to a model-serving endpoint or submitting data to a processing pipeline.

The safest pattern is to implement strict input validation before calling oneflow.index_add, ensuring shapes, index ranges, dtypes, and value constraints are enforced and rejecting malformed or extreme inputs with clear error responses.

Adopt a defensive programming approach for all low-level tensor operations: treat all externally influenced data as untrusted, apply layered input validation, add invariant checks around critical operations, and incorporate fuzzing and negative testing into the development lifecycle for numerical and ML frameworks.

Find out what's already
exploitable in your codebase.