You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When running on Linux, backslashes in a filename are improperly parsed as path separators.
To Reproduce
Steps to reproduce the behavior:
Create a file called ..\..\..\..\..\..\etc\passwd. Please note, that this is a weird, but allowed filename on Linux.
Open ghidra and press "import file"
Select the created file (in this case you might need to enable showing of . files. The bug also works with files like a\\..\\..\\b.
Ghidra tries to import /etc/passwd file instead of the file I want.
Expected behavior
Ghidra opens the file I picked in the file open dialog
Screenshots
Attachments
If applicable, please attach any files that caused problems or log files generated by the software.
Environment (please complete the following information):
OS: NixOS 24.11
Java Version: 21.0.5
Ghidra Version: 2024-Nov-05 1643 EST (11.2.1)
Ghidra Origin: nixpkgs
Additional context
The bug is not hypothetical, I got files with backslashes by extracting a 7zip archive with malware.
In practice it's not a big problem, because one can always just rename the file. But it's worth noting, that this may be a (low severity and very situational) security issue.
An additional workaround would be to import from directly inside the container zip file (instead of extracting it), where our browser would fixup the paths in a way avoids the issue.
Describe the bug
When running on Linux, backslashes in a filename are improperly parsed as path separators.
To Reproduce
Steps to reproduce the behavior:
..\..\..\..\..\..\etc\passwd
. Please note, that this is a weird, but allowed filename on Linux..
files. The bug also works with files likea\\..\\..\\b
./etc/passwd
file instead of the file I want.Expected behavior
Ghidra opens the file I picked in the file open dialog
Screenshots
Attachments
If applicable, please attach any files that caused problems or log files generated by the software.
Environment (please complete the following information):
Additional context
The bug is not hypothetical, I got files with backslashes by extracting a 7zip archive with malware.
In practice it's not a big problem, because one can always just rename the file. But it's worth noting, that this may be a (low severity and very situational) security issue.
I think the root cause is this line:
ghidra/Ghidra/Features/Base/src/main/java/ghidra/formats/gfilesystem/FSRL.java
Line 181 in 97aadfa
The error ghidra shows comes from this line:
ghidra/Ghidra/Features/Base/src/main/java/ghidra/plugin/importer/ImporterUtilities.java
Line 165 in 97aadfa
The text was updated successfully, but these errors were encountered: