Closed backcountryinfosec closed 4 years ago
Which version of fn_utilities are you using?
We're using fn-utilities==1.0.10
Are you able to upgrade to the latest version and see if the behavior is the same? fn_utilities is up to 1.0.15 now on the App Exchange
@breid1313 I'll give that a shot and let you know if the issue persists.
@backcountryinfosec looks like this is still an issue in 1.0.15, but is addressed in upcoming release 2.0.0
@breid1313 Awesome, that's great to hear. We hadn't gotten a chance to upgrade yet so we will keep that in mind as we do so.
Hey @backcountryinfosec I'm going to close this since we are aware of the bug and it's fixed in an upcoming release. Thanks for the feedback!
Description
In this script it appears that you take a string which is already base64 encoded:
base64content = str.encode(str(kwargs.get("base64content"))) # text
And then you are re base64 encoding that string before writing it to a temp file:
temp_file.write(base64.b64encode(base64content))
Based on a trial I believe that this should be a base64decode into the temp file otherwise you will have a double base64 encoded file uploaded as an artifact instead of the raw file itself.
Is this intended?
Describe How to Reproduce
This can be seen by using the stock / default version of fn_utils and sending the file content as base64 (which the function requests). It uploads the file as an artifact which is double base64 encoded instead of being the actual file content.
Believe it should be this:
temp_file.write(base64.b64decode(base64content))