telco-interop

Security and hardening

What the WBCI and S/PRI readers guarantee for XML from other companies: no DTDs, bounded input, no panics (fuzzed), no unsafe, personal data redacted.

On this page

The crates parse XML that other companies send. A bug in reading it is a security bug, so the reader both interfaces share is built for hostile input.

Reading untrusted XML馃敆

GuaranteeHow
No DTD, no entity expansiona DOCTYPE is refused; only the five predefined entities (lt gt amp apos quot) are resolved, so no billion-laughs, no external entities
Bounded inputxml::Limits: input size (1 MiB), nesting depth (32), element count (10 000), text per element (4 096 characters), S/PRI attachment size (1 MiB decoded)
Bounded repetitionsevery list is capped at the schema鈥檚 maximum, or a reader bound where the schema has none
A receipt code for every errorReadError::teq_code(): 0993 for a wrong major release, 0995 for everything else
No values in errorsan error names the element path and byte offset, never the content
Never a panicno unwrap, expect, panic! or indexing outside tests (Clippy denies them); two fuzz targets run on every push (2 minutes each)
No unsafeunsafe_code = "forbid" in every published crate; the unpublished playground module has no unsafe block or unsafe fn, only the #[unsafe(no_mangle)] attribute its WebAssembly exports need

The WBCI XML guide shows the limits in code and lists which input is refused with which receipt code.

Personal data馃敆

Names, street, house number, phone numbers, e-mail addresses, free text and attachment content print redacted in Debug (Nachname(<redacted, 10 chars>)), so logging a value does not log the customer; Display and as_str() give the value when you need it. Errors, validation issues, the losing provider鈥檚 findings, the switch timeline and its findings carry ids, dates, message types and codes only.

The playground馃敆

The playground runs the crates in your browser as WebAssembly. Its script fetches only the module and sends nothing; the page鈥檚 Content-Security-Policy allows no other origin, no inline script and no form submission. Its output is that of the command line, without personal data.

Attachments馃敆

An S/PRI attachment鈥檚 file name comes from another company. Anlage::safe_file_name() gives a name without path separators or a leading dot; never join dateiname to a folder as it is (see S/PRI attachments).

Supply chain馃敆

Three external dependencies (quick-xml, jiff, thiserror), checked with cargo deny in CI; a test fails when a dependency is added without review. The time-zone rules for Europe/Berlin are compiled in, so no system database is read at run time. No package ships an AK S&P document: CI checks every package鈥檚 file list.

What stays yours馃敆

The crates perform no I/O. TLS, WS-Security signing and verification, IP allow-listing, authentication of the peer, rate limiting and storage are your application鈥檚 job.

Reporting a vulnerability馃敆

Report privately with Report a vulnerability under GitHub Security, not in a public issue. Use synthetic data only: never real customer data, carrier certificates or production payloads.

Edit this page on GitHub 路 Report a mistake 路 API reference on docs.rs