kerberos: reject encryption types wider than Int32 - #5107
Conversation
AI-Assisted: yes (GPT-5.6-Cyber)
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #5107 +/- ##
===========================================
- Coverage 80.59% 47.48% -33.12%
===========================================
Files 390 372 -18
Lines 96892 96539 -353
===========================================
- Hits 78094 45844 -32250
- Misses 18798 50695 +31897
🚀 New features to boost your workflow:
|
|
Correct me if I'm wrong, but while a negative value properly doesn't make sense, it's still whats in the spec: https://www.rfc-editor.org/info/rfc4120/#section-5.2.9. I'm not sure I understand the issue otherwise |
|
You're right that negative values are legal, and the patch keeps them — it never looks at the value. To be precise about what it is: this is a resource bound, not validation of The reason for it is cost.
If a loose bound in a Kerberos-specific field subclass isn't worth it, the reasonable alternatives are |
|
|
Kerberos TCP reassembly parses
EncryptedData.etype, a protocolInt32, as a generic BER integer.The field accepts an attacker-declared width at
scapy/layers/kerberos.py:377-383,then shifts a growing Python integer once per byte at
scapy/asn1/ber.py:464-471.From 4,000 to 64,000 integer bytes, median processing grew from 1.40 ms to 318.41 ms, with an
exponent of 2.08 and a 3.9% noise floor. The patched parser rejected the same inputs in 0.02 ms to
0.06 ms. Its 186.6% micro-timing noise floor made a fixed exponent inconclusive, so none is claimed.
This change rejects
etypeencodings wider thanInt32before arbitrary-precision conversion.The focused regression failed on the unmodified revision and passed with the patch; ordinary
one-byte
etypevalues continue to use the existing BER decoder.