Risk Management File#
Document ID |
DHF-005 |
|---|---|
Version |
1.0 |
Date |
2026-03-22 |
Author |
camt053 Engineering |
Status |
Released |
ISO 13485 Clause |
7.3.4 (Design and Development Review) |
Additional Standards |
ISO 14971:2019 (Risk Management), IEC 62304:2006+A1 (Software Lifecycle) |
1. IEC 62304 Safety Classification#
Classification: Class A (no contribution to hazardous situation)
The camt053 library is a data transformation tool that reads ISO 20022 camt statements and generates reversing-entry XML. It does not control physical processes, medical devices, or safety-critical systems. Under IEC 62304, it is classified as Class A.
However, the project voluntarily applies Class C-level processes to demonstrate the highest level of software engineering rigor:
High branch coverage (99%+ gate)
Formal risk analysis with mitigations
Static analysis (mypy strict, bandit SAST)
Signed commits with full traceability
Structured design documentation (this DHF)
This voluntary elevation provides audit readiness for deployment in regulated financial environments and institutional settings, including Banking-as-a-Service (BaaS) and embedded-finance platforms.
2. Risk Analysis Methodology#
Risks are assessed using an ISO 14971-style framework:
Severity: Impact if the risk is realized (Low / Medium / High / Critical)
Probability: Likelihood of occurrence given normal use (Rare / Unlikely / Possible / Likely)
Risk Level: Combination of severity and probability (Low / Medium / High)
Mitigation: Engineering control implemented to reduce risk
Residual Risk: Risk level after mitigation is applied and verified
3. Risk Register#
ID |
Risk Description |
Severity |
Probability |
Initial Risk |
Mitigation |
|---|---|---|---|---|---|
R-001 |
Generated reversing entry is XSD-invalid and rejected by the receiving financial institution |
High |
Possible |
High |
Every generated reversal is validated against the official ISO 20022
camt.053.001.14 XSD via |
R-002 |
XML External Entity (XXE) / billion-laughs injection via an untrusted incoming bank statement |
Critical |
Unlikely |
High |
All statement parsing uses |
R-003 |
Path traversal attack reads or writes files outside intended directories when an output path is supplied |
Critical |
Unlikely |
High |
|
R-004 |
A statement is mis-parsed — entries, reasons, or counterparties are dropped or misread — so the wrong entries are reversed |
High |
Possible |
High |
The namespace-agnostic parser matches by local name across every ISO
version and is exercised against the official ISO 20022 business sample
messages ( |
R-005 |
Invalid BIC, IBAN, or LEI on the reversal produces a non-compliant message |
High |
Possible |
High |
|
R-006 |
The reversing entry is booked in the wrong direction (credit/debit indicator not flipped), so the reversal does not offset the original |
Critical |
Unlikely |
High |
|
R-007 |
An unknown or wrong return reason code selects the wrong entries or emits an empty reversal |
Medium |
Possible |
Medium |
Filtering is case-insensitive over both the entry reason and every
transaction detail; |
R-008 |
Invalid or unsupported message-type string causes unexpected behaviour |
Medium |
Unlikely |
Low |
|
R-009 |
Log injection via crafted user input embeds malicious content in log files |
Medium |
Unlikely |
Low |
|
R-010 |
Dependency vulnerability in third-party package introduces security flaw |
High |
Unlikely |
Medium |
Dependencies pinned to specific versions in |
R-011 |
Schema drift between the Jinja2 reversal template and the official XSD causes silent data loss or generation of non-conformant XML |
High |
Rare |
Medium |
The reversal template and the official camt.053.001.14 XSD are bundled
together under |
R-012 |
Server-side template injection (SSTI) via crafted statement field values flowing into the reversal |
Critical |
Unlikely |
High |
Jinja2 |
4. Risk Control Verification#
Risk ID |
Mitigation Control |
Verification Test File(s) |
Result |
|---|---|---|---|
R-001 |
XSD validation of every generated reversal |
|
Pass |
R-002 |
defusedxml for all statement parsing |
|
Pass |
R-003 |
Path validation with directory jail |
|
Pass |
R-004 |
Namespace-agnostic parsing of official business samples |
|
Pass |
R-005 |
BIC + IBAN + LEI format and checksum validation |
|
Pass |
R-006 |
Credit/debit indicator flip and |
|
Pass |
R-007 |
Reason-code filtering and empty-reversal guard |
|
Pass |
R-008 |
Message-container allowlist |
|
Pass |
R-009 |
Log sanitization |
|
Pass |
R-010 |
Dependency pinning + safety scanner |
CI pipeline |
Pass |
R-011 |
Reversal template / XSD validated together |
|
Pass |
R-012 |
Jinja2 autoescape=True |
|
Pass |
5. Residual Risk Assessment#
Risk ID |
Initial Risk |
Mitigation Effectiveness |
Residual Risk |
Acceptable? |
|---|---|---|---|---|
R-001 |
High |
XSD validation is deterministic and comprehensive |
Low |
Yes |
R-002 |
High |
defusedxml completely disables XXE attack surface |
Low |
Yes |
R-003 |
High |
Path jail with realpath resolution eliminates traversal |
Low |
Yes |
R-004 |
High |
Verified against the official ISO 20022 business samples |
Low |
Yes |
R-005 |
High |
ISO-standard validation algorithms are well-proven |
Low |
Yes |
R-006 |
High |
Deterministic indicator flip, covered by tests |
Low |
Yes |
R-007 |
Medium |
Empty-reversal guard prevents silent no-op output |
Low |
Yes |
R-008 |
Low |
Container allowlist rejects unrecognised messages |
Low |
Yes |
R-009 |
Low |
Control character stripping + truncation |
Low |
Yes |
R-010 |
Medium |
Pinning + scanning reduces window of exposure |
Low |
Yes |
R-011 |
Medium |
Gold master tests catch any schema drift |
Low |
Yes |
R-012 |
High |
Autoescape is a framework-level guarantee |
Low |
Yes |
Overall residual risk: Low. All identified risks have been mitigated to an acceptable level through engineering controls that are verified by automated tests and CI pipeline checks.