Closed huntergregal closed 1 year ago
@huntergregal Thank you for the bug report! Seems like a doc fix is the quickest update. An added step could be a type check in the Block constructor.
I'm working from memory, but I think every block/primitive renders to bytes
, so it really does make sense for dep_value
to be of type bytes
as well.
Report
Consider this example:
The two
URI
blocks depend on the value of the HTTP Request Method which is aGroup
with two values ofGET
orPOST
.You would expect the above code to change the requested path depending on if the request is a
GET
orPOST
. However this is NOT the case.After some debugging I found the issue is that at https://github.com/jtpereyda/boofuzz/blob/master/boofuzz/blocks/block.py#L84
dependent_value
is actually type(bytes) instead of type(str).The proper code to make the above example is:
Notice that
dep_value
has been changed to abytes
type so that the==
compare will work as expected.Based on the fact that the 2 optional values passed to the
Method
group were strings, not bytes, I consider this a bug or at best - a failure of documentation.Expected behavior
No response
Actual behavior
No response
Steps to reproduce the problem