Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LTP protocol definition has two fields that shouldn't be there #4591

Open
tadkollar opened this issue Nov 15, 2024 · 1 comment
Open

LTP protocol definition has two fields that shouldn't be there #4591

tadkollar opened this issue Nov 15, 2024 · 1 comment
Labels

Comments

@tadkollar
Copy link

Brief description

The Scapy LTP protocol implementation should not contain ConditionalFields CancelAckToBlockSender and CancelAckToBlockReceiver.

Scapy version

2.6.1

Python version

3.12

Operating system

Ubuntu 22.04

Additional environment information

RFC 5326, section 3.2.4 states that "The Cancel-acknowledgments (CAx) have no content." However, ConditionalFields CancelAckToBlockSender and CancelAckToBlockReceiver are defined for segments (scapy/contrib/ltp.py lines 176-179) with flags values 13 and 15 (cancel acknowledgement segments).

The result of this is:

  • An extra byte is appended when that type of segment is created
  • Scapy is unable to decode proper received CAx segments due to that byte missing.

How to reproduce

from scapy.contrib.ltp import LTP
from scapy.all import raw

cancel_segment = LTP(flags = 13, SessionOriginator = 1, SessionNumber = 2)
cancel_segment.show2()
print(f"Length of segment: {len(raw(cancel_segment))}")

Actual result

###[ LTP ]###
  version   = 0
  flags     = 0xD Cancel-acknowledgment segment to block sender
  SessionOriginator= 1
  SessionNumber= 2
  HeaderExtensionCount= 0
  TrailerExtensionCount= 0
  \HeaderExtensions\
  CancelAckToBlockSender= 0
  \TrailerExtensions\

Length of segment: 5

Expected result

###[ LTP ]###
  version   = 0
  flags     = 0xD Cancel-acknowledgment segment to block sender
  SessionOriginator= 1
  SessionNumber= 2
  HeaderExtensionCount= 0
  TrailerExtensionCount= 0
  \HeaderExtensions\
  \TrailerExtensions\

Length of segment: 4

Related resources

https://www.rfc-editor.org/rfc/rfc5326.html#page-20

@gpotter2 gpotter2 added the bug label Nov 16, 2024
@gpotter2
Copy link
Member

Thanks for the report.
Would you by any chance be able to share a pcap? We sadly generally don't have much tests for LTP
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants