jwt_tool icon indicating copy to clipboard operation
jwt_tool copied to clipboard

ValueError: invalid interpolation syntax

Open NAs3c opened this issue 2 years ago • 0 comments

Hi,

I encountered the following problem while trying to pass a jwt in a cookie (-rc) that was URL-encoded :

Traceback (most recent call last):
  File "C:\Tools\jwt_tool-master\jwt_tool.py", line 2002, in <module>
    config['argvals']['cookies'] = args.cookies
  File "configparser.py", line 1263, in __setitem__
  File "configparser.py", line 1205, in set
  File "configparser.py", line 895, in set
  File "configparser.py", line 402, in before_set
ValueError: invalid interpolation syntax in '...<cookie>

I solved the problem by disabling interpolation (the ability to use formatting with %s and so on) in the configparser's in jwt_tool.py like so :

line 93 -> config = configparser.ConfigParser(allow_no_value=True,strict=False, interpolation=None) line 1891 -> config = configparser.ConfigParser(strict=False, interpolation=None)

Based on : https://stackoverflow.com/questions/2537929/is-it-possible-to-temporarily-disable-pythons-string-interpolation

I am not sure interpolation is intended as a use case for this program and i suggest to make this as a permanent solution (could even raise security acutally).

Thanks for the great tool !

NAs3c avatar Aug 11 '22 08:08 NAs3c