
S2OPC (Safe & Secure OPC) における CVE-2026-90782 のスタンドアロン概念実証。
alloc_notification_message_items() (S2OPC 1.7.3 以前) において:
status 変数が DataChange と Event の両方の割り当てに使用されている。status が SOPC_STATUS_OK で上書きされる。dataChangeNotif ポインタを逆参照する → NULL 逆参照 / クラッシュ。gcc -o s2opc_poc reproducer.c
# Test 1 — both allocations succeed (no crash)
./s2opc_poc 1
# Test 2 — vulnerable path: DataChange fails, Event succeeds → NULL deref (crash)
./s2opc_poc 2
# Test 3 — fixed path: independent status tracking, no crash
./s2opc_poc 3
# Test 4 — control: data-only (no Event alloc to clobber status)
./s2opc_poc 4
AddressSanitizer の使用を推奨:
gcc -fsanitize=address -g -o s2opc_poc reproducer.c
./s2opc_poc 2
割り当てステータスを独立して追跡し、DataChange の割り当てが失敗した場合は早期終了 / 逆参照をスキップする。コミット 8848f051 のパターンを踏襲している。
reproducer.c — 脆弱な割り当てロジックと修正済みの割り当てロジックを再現