commixproject / commix

Automated All-in-One OS Command Injection Exploitation Tool.
https://commixproject.com
Other
4.62k stars 818 forks source link

Bug Report: Unhandled exception "TypeError: 'str' object does not support item assignment" (#3a36fdbd) #978

Closed commixreporter closed 1 week ago

commixreporter commented 2 weeks ago
Commix version: 4.0-dev#106
Python version: 3.12.3
Operating system: posix
Command line: commix.py -r *************************** --all
Traceback (most recent call last):
  File \"commix.py", line 36, in <module>
    main()
  File \"commix.py", line 31, in main
    import src.core.main
  File \"main.py", line 899, in <module>
    main(filename, url, http_request_method)
  File \"main.py", line 560, in main
    controller.do_check(url, http_request_method, filename)
  File \"controller.py", line 743, in do_check
    perform_checks(url, http_request_method, filename)
  File \"controller.py", line 706, in perform_checks
    data_checks(url, http_request_method, filename, timesec)
  File \"controller.py", line 623, in data_checks
    if post_request(url, http_request_method, filename, timesec) is None:
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File \"controller.py", line 598, in post_request
    found_parameter = parameters.do_POST_check(parameter, http_request_method)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File \"parameters.py", line 434, in do_POST_check
    parameter = json_int_check(parameter, value)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File \"parameters.py", line 277, in json_int_check
    parameter = unflatten_list(parameter)
                ^^^^^^^^^^^^^^^^^^^^^^^^^
  File \"flatten_json.py", line 131, in unflatten_list
    unflattened_dict = unflatten(flat_dict, separator)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File \"flatten_json.py", line 111, in unflatten
    _unflatten(unflattened_dict, item.split(separator), flat_dict[item])
  File \"flatten_json.py", line 108, in _unflatten
    dic[keys[-1]] = value
    ~~~^^^^^^^^^^
TypeError: 'str' object does not support item assignment
stasinopoulos commented 1 week ago

Verified via using the following nested JSON:

{ "count": 2, "results": [ { "test": 2, "related_object": { "happiness": { "assessment": "1", "assessment_verbose": "Neutral" } } } ] }