Summary
OneFlow v0.9.0 contains an improper input validation flaw in the flow.arange() component that allows crafted inputs to trigger abnormal behavior.
When an attacker can influence the parameters passed to flow.arange(), they may cause resource exhaustion or runtime errors that result in a Denial of Service (DoS) for applications using OneFlow.
Affected context
The vulnerability appears in environments where OneFlow v0.9.0 is used and user-controlled or untrusted data can reach the flow.arange() API.
It is most relevant in machine learning or numerical computation services that expose parameterized operations (e.g., via REST, gRPC, or notebook environments) and do not strictly sanitize or constrain numeric ranges, step sizes, or data types before invoking flow.arange().
Exploit preconditions
- Attack surface: Any interface that allows a user, client, or upstream system to supply arguments to flow.arange().
- Required access: Ability to submit or influence input values (e.g., API request, job configuration, script parameter).
- Trigger point: Passing maliciously crafted arguments (such as extreme bounds, invalid steps, or pathological sizes) into flow.arange().
- Why exploitation is possible: The implementation does not adequately validate or constrain input parameters before using them internally, allowing operations that can exhaust CPU, memory, or other resources and cause service unavailability.
Why this happens
The underlying bug is improper input validation as described by CWE-20.
The flow.arange() component accepts numeric arguments that define a range, but it does not robustly check for invalid, extreme, or unexpected values (e.g., very large ranges, non-sensical boundaries, or edge-case parameters).
Without enforcing safe limits or rejecting malformed inputs, the function can initiate resource-intensive operations or hit error conditions that propagate into process crashes or hangs, manifesting as a Denial of Service for dependent applications.
Potential impact
- Application or service crashes when invoking vulnerable OneFlow operations.
- Degradation of performance due to excessive CPU or memory consumption.
- Temporary unavailability of machine learning inference or training endpoints.
- Potential cascading failures in distributed or orchestrated environments relying on OneFlow jobs.
General mitigation guidance
Mitigation centers on reducing trust in external parameters and enforcing safe operating bounds around numeric operations:
- Validate and sanitize all user- or client-controlled inputs before passing them to flow.arange(), including type checks and range limits.
- Introduce explicit upper bounds on range sizes, step sizes, and number of elements that can be requested per operation.
- Enforce input schemas at API boundaries so that invalid or extreme values are rejected early with clear error responses.
- Apply resource governance at the application level, such as timeouts, memory limits, and request quotas, so that a single computation cannot monopolize system resources.
- Prefer safe-by-default wrapper functions around low-level numerical APIs that centralize validation logic rather than relying on call sites.
How teams detect issues like this
Detection generally involves both code-centric and operational approaches:
- Use static analysis or linters to flag direct use of numerical APIs (like flow.arange()) that accept external input without preceding validation.
- During code review, look for patterns where user-supplied parameters are forwarded into range-constructing functions without bounds checking or type normalization.
- Implement runtime monitoring and alerting on abnormal spikes in CPU, memory usage, or error rates around OneFlow-based services, which may indicate attempts to trigger resource exhaustion.
- Employ automated testing and fuzzing focused on numerical input boundaries, large sizes, and malformed parameters to uncover unstable behavior when invoking flow.arange().

