Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix for audit.file_upload: when an extension that did not have a m… #18818

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions w3af/plugins/audit/file_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def audit(self, freq, orig_response, debugging_id):
for file_parameter in freq.get_file_vars():
for extension in self._extensions:

_, file_content, file_name = get_template_with_payload(extension, payload)
success, file_content, file_name = get_template_with_payload(extension, payload)

# Only file handlers are passed to the create_mutants functions
named_stringio = NamedStringIO(file_content, file_name)
Expand All @@ -113,7 +113,7 @@ def audit(self, freq, orig_response, debugging_id):
mutant.uploaded_file_name = file_name
mutant.extension = extension
mutant.file_content = file_content
mutant.file_payload = payload
mutant.file_payload = payload if success else file_content # If the specified extension does not have a template, use the generated file contents as a payload instead
mutant.debugging_id = debugging_id

self._send_mutants_in_threads(self._uri_opener.send_mutant,
Expand Down