Summary
EVerest's EV charging software stack used assert statements for error handling in several modules, causing them to terminate when certain unexpected conditions or inputs occurred.
Because the central manager shuts down all modules when any single module exits, this behavior can be leveraged to trigger a denial of service that affects all connected charging points and users.
Affected context
The issue arises in EVerest deployments where the manager process supervises multiple EVSE-related modules and is configured to terminate all modules if any one of them crashes.
In these environments, internal assertions are used as a control-flow mechanism for handling unexpected states or malformed input.
When an assertion is hit, the affected module exits abnormally, causing the manager to shut down, disrupting charging services across all managed EVSEs rather than isolating the failure to a single component.
Exploit preconditions
- Attack surface: Interfaces and data paths that can cause modules to hit assertion conditions (e.g., malformed messages, unexpected protocol states, or invalid configuration).
- Required access: Ability to influence module inputs or operational state, which may be possible via network protocols, misconfiguration, or interaction with connected devices.
- Trigger point: Submission or induction of input or state that violates an asserted condition inside a module.
- Why exploitation is possible: Assertions are treated as a runtime safety net rather than proper input validation and error handling; when triggered, they cause process termination, which in turn leads the manager to shut down all modules.
Why this happens
The root cause is the misuse of assert for handling invalid input and runtime errors in production code.
Assertions are intended as development-time checks that abort execution when an invariant is broken, not as a robust mechanism for validating external or potentially malformed input.
Mapping to CWE-20: Improper Input Validation, the system trusts that external and internal inputs will always satisfy assert conditions; when this assumption fails, modules terminate instead of gracefully rejecting the input or entering a controlled error state.
The manager's design choice to stop all modules when any one exits amplifies the impact of each assertion failure into a system-wide denial of service.
Potential impact
- Charging services for all EVSEs managed by the affected EVerest instance may become unavailable.
- Active charging sessions can be interrupted, impacting multiple users simultaneously.
- Automated charging infrastructure, such as fleet chargers or public charging stations, can experience outages until the manager is restarted.
- Repeated triggering of assertion paths can lead to persistent service instability and reduced trust in the charging platform.
General mitigation guidance
Mitigation generally involves replacing assertion-based error handling with explicit, resilient input validation and fault containment mechanisms.
Useful patterns include:
- Validating all externally influenced data (protocol messages, configuration values, sensor inputs) before use, with clear rejection or fallback behavior for invalid cases.
- Replacing
assertin production paths with structured error handling (error codes, exceptions, or well-defined failure states) that keep the process running when possible. - Designing the manager to isolate module failures, allowing individual modules to restart or degrade gracefully rather than shutting down the entire system.
- Applying defensive programming practices, such as enforcing strict type and range checks, before critical state transitions.
- Segmenting responsibilities so that a failure in one EVSE-related module does not automatically cascade to all others.
How teams detect issues like this
Detection efforts can focus on both code-level patterns and runtime behavior:
- Static analysis and code review rules that flag use of
assertin production code paths, especially around input handling and protocol processing. - Architectural reviews to identify components where a single module's exit leads to system-wide shutdown, marking them as high-risk chokepoints.
- Logging and monitoring that track module exits and manager shutdown events, correlating them with unusual input or operational conditions.
- Integration and fuzz testing against module interfaces to identify inputs that trigger assertion failures or abrupt terminations.
- Automated code scanning tools configured with policies that discourage assertion use outside of test and debug builds.

