Skip to content

Dot15d4 aux_sec_header incorrect parsing #4928

@tomasrosenbaum-tuvsud

Description

@tomasrosenbaum-tuvsud

Brief description

Dot15d4 incorrectly parses Auxiliary Security Header.

Scapy version

2.7.0

Python version

3.13.11

Operating system

Kali 2025.4

Additional environment information

No response

How to reproduce

Example: Dot15d4(b'\x08\xD0\x84\x21\x43\x01\x00\x00\x00\x00\x48\xDE\xAC\x02\x05\x00\x00\x00\x55\xCF\x00\x00\x51\x52\x53\x54\x22\x3B\xC1\xEC\x84\x1A\xB5\x53')

Actual result

Should get parsed as Dot15d4 > Dot15d4Beacon with aux_sec_header set > Raw.

Expected result

Instead it gets parsed as Dot15d4 > Dot15d4Beacon (with incorrect values) > ZigbeeBeacon > Raw.

Related resources

There are two problems:

Fixes:

  • modify this line in Dot15d4Beacon, Dot15d4Cmd and Dot15d4Data:
ConditionalField(PacketField("aux_sec_header", Dot15d4AuxSecurityHeader(), Dot15d4AuxSecurityHeader), lambda pkt:pkt.underlayer.getfieldval("fcf_security") is True)

to:

ConditionalField(PacketField("aux_sec_header", Dot15d4AuxSecurityHeader(), Dot15d4AuxSecurityHeader), lambda pkt:pkt.underlayer.getfieldval("fcf_security"))
  • add this method to Dot15d4AuxSecurityHeader:
def extract_padding(self, s):
  return b'', s

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions