Expand description
LDAPv3 server with hand-written ASN.1 BER coding.
No LDAP crate is used, so this module decodes attacker-controlled BER by hand — the
highest-risk parsing in the file-service protocol group. The invariant every decoder here
keeps: no index or range is used before it has been checked against the remaining
buffer. read_ber_element is the single entry point, and it validates that an element’s
claimed length actually fits before handing back a value slice; nothing else slices raw
input. Recursion (search filters) is depth-limited, and message size is capped.
There is no directory. A bind is granted by the model, a search returns entries the model names, and add/modify/delete are acknowledged without anything changing here, because there is nothing here to change. Whether a following search agrees with an earlier add is the model’s memory to keep.
Not implemented: SASL (the mechanism is reported so it can be refused), StartTLS, LDAPS, referrals, controls, extended operations, compare, modifyDN, and abandon. Search scope, filter and requested-attribute list are decoded and handed to the model as text, but never evaluated here.
Modules§
- actions
- LDAP protocol actions implementation.
Structs§
- Ldap
Server - LDAP server that handles directory operations with LLM
- Search
Request Fields - What a SearchRequest tells the model: the fields of
ldap_search’s event data.
Constants§
- MAX_
FILTER_ DEPTH - Maximum search-filter nesting rendered. Filters are recursive and client-supplied, so an unbounded renderer would overflow the stack on a deliberately deep filter.
- MAX_
LDAP_ MESSAGE - Largest LDAP message accepted, in bytes. A long-form length header can promise up to 4 GiB.
Functions§
- decode_
ldap_ message - Split an LDAPMessage into
(messageID, protocolOp tag, protocolOp content). - ldap_
message_ len - Length of the complete LDAPMessage at the front of
buffer, if it has all arrived. - parse_
search_ request - Decode a SearchRequest’s content octets.