Skip to content

pnio_rpc: dissect PRAL_AlarmItem - #5246

Merged
gpotter2 merged 1 commit into
secdev:masterfrom
bIackr0se:fix/pnio-pral-alarm-item
Oct 24, 2026
Merged

gpotter2 merged 1 commit into
secdev:masterfrom
bIackr0se:fix/pnio-pral-alarm-item

Conversation

@bIackr0se

Copy link
Copy Markdown
Contributor

Description

PRAL_AlarmItem takes the length of PRAL_ReasonAddValue from x.len, but the item has no len field. Dissection raises AttributeError, so every alarm with UserStructureIdentifier 0x8320 is dissected as Raw:

from scapy.contrib.pnio_rpc import *
p = AlarmNotification_High(bytes.fromhex(
    "00010024010000020000000000010001000000320000000188008320000000010003000000010000"))
p.AlarmPayload

Before:

[<Raw  load=b'\x83 \x00\x00\x00\x01\x00\x03\x00\x00\x00\x01\x00\x00' |>]

After:

[<PRAL_AlarmItem  UserStructureIdentifier=0x8320 ChannelNumber=0x0 PRAL_ChannelProperties=0x1 PRAL_Reason=0x3 PRAL_ExtReason=0x0 PRAL_ReasonAddValue=b'\x00\x01\x00\x00' |>]

PRAL_ReasonAddValue now takes the rest of the item, as in Wireshark's dissect_PRAL_AlarmItem, which ends the alarm block after this item.

This message was written with the help of AI (Claude Opus 5.5).

PRAL_ReasonAddValue took its length from a `len` field that the item
does not have, so every alarm with UserStructureIdentifier 0x8320 was
dissected as Raw. The value now takes the rest of the alarm item, as
in Wireshark's dissect_PRAL_AlarmItem.

AI-Assisted: yes (Claude Opus 5.5, GPT-6.1 Sol)
@gpotter2
gpotter2 force-pushed the fix/pnio-pral-alarm-item branch from b98be94 to f12bae0 Compare October 24, 2026 16:30
@gpotter2
gpotter2 enabled auto-merge (squash) October 24, 2026 16:30
@gpotter2

Copy link
Copy Markdown
Member

Thanks for the PR !

@codecov

codecov Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.41%. Comparing base (0a598f7) to head (f12bae0).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5246      +/-   ##
==========================================
- Coverage   80.42%   80.41%   -0.01%     
==========================================
  Files         376      376              
  Lines       98405    98405              
==========================================
- Hits        79142    79136       -6     
- Misses      19263    19269       +6     
Files with missing lines Coverage Δ
scapy/contrib/pnio_rpc.py 94.66% <ø> (ø)

... and 5 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gpotter2
gpotter2 merged commit 770ab0f into secdev:master Oct 24, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants