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
The ScannerFacade#getFilename method uses a hard-coded '/' as path separator, causing the method not to work properly on Windows, as windows uses backslashes as path separator.
@h3xstream Sorry for taking that long to respond; only seeing your question now.
This happens to me when I run the DependencyCheck Gradle plugin on my project. Retirejs is unable to parse the filename/version number for one of my dependencies correctly because of this, leading to a false positive.
To be more specific: when com.h3xstream.retirejs.repo.ScannerFacade#getFilename is handed a path like c:\a\b\123\myapp\libs\somelib.min.js, it returns :\a\b\123\myapp\libs\somelib.min.js,. Subsequently VulnerabilitiesRepository#findByFileName wrongfully assumes the library version is 123.
The ScannerFacade#getFilename method uses a hard-coded '/' as path separator, causing the method not to work properly on Windows, as windows uses backslashes as path separator.
In this code, the
lastSlash
variable will always be 0, as a Windows path (or filename) cannot contain forward slashes.It probably should use something like
File.pathSeparator
instead of the hard-coded '/'.The text was updated successfully, but these errors were encountered: