From fc1ece3afeba203a43bd0e9024c9aa9b48d82c2d Mon Sep 17 00:00:00 2001 From: meme-lord Date: Sun, 1 Aug 2021 22:40:22 +0100 Subject: [PATCH] Bugfix for canSeeCache when request is null --- src/burp/ParamGuesser.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/burp/ParamGuesser.java b/src/burp/ParamGuesser.java index 6b8f13a..9d6f229 100644 --- a/src/burp/ParamGuesser.java +++ b/src/burp/ParamGuesser.java @@ -2,9 +2,6 @@ import org.apache.commons.collections4.queue.CircularFifoQueue; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.PrintWriter; import java.util.*; import java.util.concurrent.ThreadPoolExecutor; @@ -590,6 +587,10 @@ private boolean tryReflectCache(PayloadInjector injector, String param, IHttpReq private static boolean canSeeCache(byte[] response) { + if(response == null){ + Utilities.out("WARNING: canSeeCache() cannot check headers of null response"); + return false; + } String[] headers = new String[]{"Age", "X-Cache", "Cache", "X-Cache-Hits", "X-Varnish-Cache", "X-Drupal-Cache", "X-Varnish", "CF-Cache-Status", "CF-RAY"}; for(String header: headers) { if(Utilities.getHeaderOffsets(response, header) != null) {