You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Version: 1.3
Created: 2026-02-28
Next Review: 2029-02-28
System Overview
Description
AsicSharp is a .NET library and CLI tool for creating and verifying ASiC-S (Simple) and ASiC-E (Extended) Associated Signature Containers with RFC 3161 timestamps. It proves that data existed at a specific point in time using trusted Timestamp Authorities (TSAs). Compliant with ETSI EN 319 162-1 (ASiC-S), ETSI EN 319 162-2 (ASiC-E), and EU eIDAS.
Components
Component
Description
Technology
AsicSharp (library)
Core library for ASiC-S/ASiC-E creation/verification
ZIP containing data + timestamp + optional signature
ASiC-E container (.asice)
Same as input data
ZIP containing multiple data files + ASiCManifest + timestamp + optional signature
ASiCManifest XML
Integrity-critical
Lists file digests; timestamp covers this manifest
STRIDE Analysis
S — Spoofing
ID
Threat
Attack Path
Likelihood
Impact
Score
Mitigation
S-1
Rogue TSA server
Attacker configures a malicious TSA URL to issue fake timestamps
1 (Very Low)
3 (High)
3
TSA URL is caller-configured, not user-input. Library validates the cryptographic signature on TSA responses. Forged tokens fail verification.
S-2
TSA certificate compromise
A TSA's signing key is compromised, allowing forged timestamps
1 (Very Low)
4 (Critical)
4
Relies on TSA operational security and CA revocation. Outside library scope.
S-3
Revoked signing certificate accepted
CMS signature verification does not enforce revocation checking
2 (Low)
2 (Medium)
4
.NET's SignedCms.CheckSignature(false) performs chain validation. Revocation checking depends on platform configuration. CMS signing is optional.
Countermeasures in place:
TSA responses are cryptographically validated using Rfc3161TimestampToken.VerifySignatureForHash
Certificate chain validation via .NET PKI APIs
Library does not accept TSA URLs from untrusted input (developer-configured)
T — Tampering
ID
Threat
Attack Path
Likelihood
Impact
Score
Mitigation
T-1
ZIP path traversal on extract
Malicious ASiC-S container contains ZIP entry with ../ in filename; CLI extract writes to arbitrary path
1 (Very Low)
4 (Critical)
4
Mitigated.Extract() and Verify() apply Path.GetFileName() to strip directory components from ZIP entry names. Fixed in #1.
T-2
Data tampering in container
Attacker modifies data inside an ASiC-S container
2 (Low)
3 (High)
6
Verification detects hash mismatch. Timestamp token binds to original data hash.
T-3
Timestamp replay
Attacker replays a previously captured timestamp token
1 (Very Low)
2 (Medium)
2
Mitigated.TsaClient generates a random 8-byte nonce when UseNonce is true (default). ProcessResponse validates the nonce in the TSA response. Tokens are also bound to a specific data hash.
T-4
TSA response interception (HTTP)
TSA URLs use HTTP; MITM could intercept and modify responses
1 (Very Low)
3 (High)
3
RFC 3161 TSA responses are cryptographically signed — a modified response fails ProcessResponse validation regardless of transport. HTTP is standard for TSAs (security is in the signature, not the transport).
T-5
XXE/XML bomb in ASiCManifest
Malicious ASiC-E container contains crafted ASiCManifest.xml with external entity references or recursive expansion
1 (Very Low)
3 (High)
3
Mitigated.XDocument.Parse() in .NET does not process DTDs or resolve external entities by default. XML bomb expansion is bounded by .NET's default XML reader limits.
T-6
ASiCManifest digest mismatch
Attacker modifies a data file in an ASiC-E container without updating the manifest
2 (Low)
3 (High)
6
Mitigated. Verification recomputes each file's digest and compares against the manifest. The timestamp binds to the manifest bytes, so manifest changes are also detected.
T-7
Archive timestamp chain tampering
Attacker modifies or replaces an intermediate archive timestamp token in a renewal chain
1 (Very Low)
3 (High)
3
Mitigated. Each archive timestamp covers the previous token's raw bytes. Chain verification walks all tokens in order and verifies each hash link. Any modification breaks the chain.
Countermeasures in place:
SHA-256 hash binding between data and timestamp token
Cryptographic signature verification on timestamp tokens
ValidateFileName() prevents path separators in filenames during creation
Path.GetFileName() sanitizes ZIP entry names during extraction and verification
Random nonce included in timestamp requests (replay protection)
Rfc3161TimestampRequest.ProcessResponse validates response integrity and nonce
ASiC-E digest verification: each file's hash verified against ASiCManifest, manifest hash verified against timestamp
Archive timestamp chain verification: each renewal token's hash verified against the previous token's bytes
XDocument.Parse() used for manifest parsing (safe XML defaults, no DTD processing)
R — Repudiation
ID
Threat
Attack Path
Likelihood
Impact
Score
Mitigation
R-1
No audit trail for operations
Library does not log who created/verified containers or maintain an audit trail
2 (Low)
2 (Medium)
4
Structured logging via ILogger at Debug/Information levels. Calling application can capture and persist logs.
Configurable timeout (default 30s). HttpRequestException thrown on failure. Caller can retry or use alternate TSA.
D-2
ZIP bomb in container
Malicious ASiC-S with highly compressed entry causes memory exhaustion during verification
1 (Very Low)
3 (High)
3
Container bytes are fully loaded into memory via byte[] API. .NET ZipArchive provides basic protection against unbounded expansion.
D-3
Large file processing
Very large input file(s) cause memory pressure (all data loaded via ReadAllBytes). ASiC-E amplifies this with multiple files.
2 (Low)
2 (Medium)
4
Mitigated. Configurable MaxFileSize option (default 10 MB) rejects oversized files before processing. Set to null to disable. Stream-based CreateAsync(Stream, ...) overload also available for ASiC-S.
D-4
Unbounded timestamp chain growth
Repeated RenewAsync calls grow the container by one .tst entry each time
1 (Very Low)
1 (Low)
1
Each archive timestamp is small (~2-4 KB). Renewal is an explicit caller action, not automatic. Container size growth is negligible over typical renewal cycles (years).
Library trusts TSA certificate chain; TSA compromise is outside scope
SHA-1 backward compatibility
Low
Supported for legacy TSA tokens; SHA-256 is the default and recommended
HTTP transport for TSA
Low
Standard practice — RFC 3161 security relies on cryptographic signatures, not transport
Security Controls Summary
Category
Implementation
Cryptography
SHA-256/384/512 via .NET APIs; RFC 3161 timestamp tokens with nonce replay protection; CMS/CAdES detached signatures; archive timestamp chain verification for renewal
Input Validation
ValidateFileName() on creation (rejects duplicates for ASiC-E); Path.GetFileName() on extraction; null/empty checks on all public APIs; file existence checks
XML Processing
XDocument.Parse() for ASiCManifest (safe defaults: no DTD, no external entities); digest verification per DataObjectReference
Certificate Validation
Rfc3161TimestampToken.VerifySignatureForHash; SignedCms.CheckSignature with chain validation
Error Handling
Custom exception hierarchy (AsicTimestampException → specific subtypes); structured logging
Transport
HttpClient with configurable timeout; TSA response validation independent of transport