aboutsummaryrefslogtreecommitdiffstats
path: root/src/paste.rs
diff options
context:
space:
mode:
authormurilo ijanc2026-03-25 14:22:21 -0300
committermurilo ijanc2026-03-25 14:22:21 -0300
commitb9f813fb4b7de1042370b529b9ccc036b208465b (patch)
tree488568d9216bf8ea62625eedc7dc718e8afbd690 /src/paste.rs
parent57176d45cacb98f1968daa8f8b2efd2735da2731 (diff)
downloadtesseras-paste-b9f813fb4b7de1042370b529b9ccc036b208465b.tar.gz
Fix critical data integrity and security issues
- Atomic writes in store (write-to-temp + rename) to prevent corruption on crash - Validate DHT results against requested content hash to reject forged data from malicious nodes - Limit protocol line size to 128 KiB on Unix socket to prevent memory exhaustion - Use saturating_add for TTL expiry to prevent u64 overflow
Diffstat (limited to 'src/paste.rs')
-rw-r--r--src/paste.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/paste.rs b/src/paste.rs
index 50b32b1..8bfe979 100644
--- a/src/paste.rs
+++ b/src/paste.rs
@@ -81,7 +81,7 @@ impl Paste {
.duration_since(std::time::UNIX_EPOCH)
.unwrap_or_default()
.as_secs();
- now > self.created_at + self.ttl_secs
+ now > self.created_at.saturating_add(self.ttl_secs)
}
}