← ALL ADVISORIES

HIGH BYTERAY-2026-0290Patched

EVerest — Out-of-Bounds Read in EvseV2G PowerDelivery Schedule Lookup

In EvseV2G ISO 15118-2 PowerDelivery, an unmatched SAScheduleTupleID leaves the loop index equal to arrayLen and still passes that index into check_iso2_charging_profile_values. When the EV includes a ChargingProfile, the validator indexes one element past the active schedule tuple list.

Advisory
BYTERAY-2026-0290
CWE
CWE-125
CVSS
7.6 (CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:H); 7.1 (CVSS:4.0/AV:A/AC:L/AT:N/PR:N/UI:N/VC:L/VI:L/VA:H/SC:N/SI:N/SA:N)
Vendor
LF Energy
Product
EVerest
Reported
2026-11-05
Disclosure
2026-11-05
Affected
EVerest before 2026.02.2 (all releases prior to 2026.02.0, and 2026.02.0 through 2026.02.1), EvseV2G ISO 15118-2
Fixed in
EVerest 2026.02.2 (commit 0ba567992fba6eda70200f5e4debb916e61fa121) and 2026.10.0 (commit 4fe60c65071c62d9fb3885019de4eb369322044f, PR 3042)
Credit
Mehrun P. Hunter and Shahriyar Jalayeri, ByteRay Ltd.

Executive Summary

During an ISO 15118-2 PowerDelivery request, handle_iso_power_delivery in EvseV2G searches the charger's offered SAScheduleTuple list for the SAScheduleTupleID requested by the vehicle. If no entry matches, the loop stops with sa_schedule_tuple_idx == arrayLen and entry_found == false. The handler records FAILED_TariffSelectionInvalid on the response, then calls check_iso2_charging_profile_values anyway with the post-loop index.

When the request also carries a ChargingProfile, check_iso2_charging_profile_values indexes SAScheduleTuple.array[sa_schedule_tuple_idx] without checking entry_found or comparing the index against arrayLen. When all three generated SAScheduleTuple slots are populated (arrayLen == 3), index 3 reads past the end of SAScheduleTuple.array. When fewer slots are populated (such as the default single-tuple setup where arrayLen == 1), it reads an unselected slot past the live list.

Affected Products and Versions

  • Product: LF Energy EVerest, EvseV2G module (modules/EVSE/EvseV2G/iso_server.cpp), ISO 15118-2 server path.
  • Affected versions: EVerest versions before 2026.02.0, and 2026.02.0 through 2026.02.1.
  • Tested on: EVerest commit e640fb4aa080a3dc27b653daa5d607f041e07077.
  • Fixed in: EVerest 2026.02.2 (0ba567992fba6eda70200f5e4debb916e61fa121, backport PR 3314) and the 2026.10.0 line (4fe60c65071c62d9fb3885019de4eb369322044f, PR 3042).

Technical Details

In modules/EVSE/EvseV2G/iso_server.cpp, handle_iso_power_delivery walks the active schedule tuples at lines 1822-1837:

for (sa_schedule_tuple_idx = 0;
     sa_schedule_tuple_idx < conn->ctx->evse_v2g_data.evse_sa_schedule_list.SAScheduleTuple.arrayLen;
     sa_schedule_tuple_idx++) {
    if (conn->ctx->evse_v2g_data.evse_sa_schedule_list.SAScheduleTuple.array[sa_schedule_tuple_idx]
            .SAScheduleTupleID == req->SAScheduleTupleID) {
        entry_found = true;
        conn->ctx->session.sa_schedule_tuple_id = req->SAScheduleTupleID;
        break;
    }
}

res->ResponseCode =
    (entry_found == false) ? iso2_responseCodeType_FAILED_TariffSelectionInvalid : res->ResponseCode;

check_iso2_charging_profile_values(req, res, conn, sa_schedule_tuple_idx);

check_iso2_charging_profile_values (lines 137-159) dereferences the schedule slot whenever the vehicle sets ChargingProfile_isUsed:

if (req->ChargingProfile_isUsed == (unsigned int)1) {
    const struct iso2_PMaxScheduleType* evse_p_max_schedule =
        &conn->ctx->evse_v2g_data.evse_sa_schedule_list
             .SAScheduleTuple.array[sa_schedule_tuple_idx]
             .PMaxSchedule;

The subsequent loop reads evse_p_max_schedule->PMaxScheduleEntry.arrayLen and its RelativeTimeInterval entries.

The generated struct iso2_SAScheduleTupleType backs SAScheduleTuple.array with three elements (iso2_SAScheduleTupleType_3_ARRAY_SIZE). In configurations where SAScheduleTuple.arrayLen is 1 (v2g_ctx.cpp:219 and iso_server.cpp:1507), an unmatched tuple ID leaves sa_schedule_tuple_idx == 1, which reads past the live list into the zero-initialized second element of the fixed array. When all three slots are populated (arrayLen == 3), an unmatched ID leaves sa_schedule_tuple_idx == 3 and reads past the end of SAScheduleTuple.array into adjacent fields of evse_v2g_data (caught under sanitizer builds in upstream PR 3042).

Reachability and Preconditions

  • The charger runs EvseV2G with ISO 15118-2 enabled.
  • The attacker is a plugged-in EV (or PLC link peer) that reaches the PowerDelivery state and sends an unknown SAScheduleTupleID with ChargingProfile_isUsed = 1 and at least one ProfileEntry.
  • Under the shipped tls_security: allow default in EvseV2G, the session can run over plaintext TCP without TLS authentication.

Impact

Out-of-bounds read (CWE-125) past the active SAScheduleTuple list in EvseV2G. When arrayLen reaches the 3-slot capacity of SAScheduleTuple.array, indexing array[3] reads adjacent memory in v2g_context and can crash EvseV2G or trigger sanitizer traps, interrupting charging sessions on the station. When arrayLen is smaller than 3, the read stays inside the fixed struct allocation and evaluates the profile loop against an unselected zeroed slot while ResponseCode is already FAILED_TariffSelectionInvalid.

Remediation and Mitigation

Upgrade to EVerest 2026.02.2 or a 2026.10.0 build containing commit 4fe60c65071c62d9fb3885019de4eb369322044f (PR 3042, backported as 0ba567992fba6eda70200f5e4debb916e61fa121 in PR 3314). The fix calls check_iso2_charging_profile_values only when entry_found is true.

Requiring TLS (tls_security: force) prevents unauthenticated plaintext TCP peers from reaching PowerDelivery, though any vehicle able to establish a V2G session can still send an unmatched SAScheduleTupleID.

Timeline

  • 2026-10-09 — Upstream fix merged to main in PR 3042 (4fe60c65071c62d9fb3885019de4eb369322044f), and backported to stable/2026.02 on 2026-10-29 (0ba567992fba6eda70200f5e4debb916e61fa121).
  • 2026-11-05 — Reported to EVerest by ByteRay; EVerest released 2026.02.2 and published GHSA-w85r-c79f-2h29.

Credits

Discovered and reported by Mehrun P. Hunter and Shahriyar Jalayeri of ByteRay Ltd.

EVerest credited @Mehrrun in the 2026.02.2 release notes and published GHSA-w85r-c79f-2h29.

References