Closed Sumitsahu896 closed 3 years ago
@DamoSWL @shawnwork @QuuikSilva98 please, review the bug report and confirm the criticality. Also, patch the fix to resolve the issue.
@DamoSWL you have to explain before you close an issue. This was very rude.
this has been solved
util.cpp : 145, 152, 158 (strncpy)
strcpy
depends on a trailing \0, which may not always occur. This might result in getting more inputs (or tokens and commands in this case) and will mess up the desired out. The adversary might result in using more than required commands to get the list of files or trigger more vulnerable commands. And since this piece of code accepts multiple commands, it might act as a catalyst for the breach.For a "safer
strcpy()
", you are better off usingstrncat()
like so:That will always nul-terminate the result, and won't copy more than necessary.