Compression bomb in Tor logs

[WARN] Possible compression bomb; abandoning stream.
[WARN] Unable to decompress HTTP body (tried Zstandard compressed, on Directory connection
AD0FCFD83EA4899DB34735E599701592DEA13690

Can you please share more of your Tor logs?

This might be related to: [tor-relays] Compression bomb from dizum

1 Like
check if corrupted
diff --git a/src/lib/compress/compress_zstd.c b/src/lib/compress/compress_zstd.c
index 34a2e80..85c2bb3 100644
--- a/src/lib/compress/compress_zstd.c
+++ b/src/lib/compress/compress_zstd.c
@@ -368,6 +368,13 @@ tor_zstd_compress_process(tor_zstd_compress_state_t *state,
                                    &output, &input);
   }
 
+  if (ZSTD_isError(retval)) {
+    log_warn(LD_GENERAL, "Zstandard %s didn't finish: %s.",
+             state->compress ? "compression" : "decompression",
+             ZSTD_getErrorName(retval));
+    return TOR_COMPRESS_ERROR;
+  }
+
   state->input_so_far += input.pos;
   state->output_so_far += output.pos;
 
@@ -383,13 +390,6 @@ tor_zstd_compress_process(tor_zstd_compress_state_t *state,
     return TOR_COMPRESS_ERROR;
   }
 
-  if (ZSTD_isError(retval)) {
-    log_warn(LD_GENERAL, "Zstandard %s didn't finish: %s.",
-             state->compress ? "compression" : "decompression",
-             ZSTD_getErrorName(retval));
-    return TOR_COMPRESS_ERROR;
-  }
-
   if (state->compress && !state->have_called_end) {
     retval = ZSTD_flushStream(state->u.compress_stream, &output);