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
Multiple errors are printed to the console for each vulnerability when running snyk-to-html outside of the scanned projects root directory and using the output of snyk code test....
In addition to the errors, the "Data Flow" portion of the resulting HTML does not correctly display the vulnerable code.
Tested versions
snyk-to-html:
v2.3.2
snyk:
shouldn't matter
How to Reproduce
npm install -g snyk-to-html@latest
mkdir scratch
cd scratch
npm init -y
npm install axios
cat <<EOF > index.jsimport axios from 'axios'function fail(req, res) { return res.status(401).send(req.query)}EOF
snyk code test --json > ../snyk.json
cd ..
snyk-to-html -i snyk.json -o snyk.html
Example Output
$ snyk-to-html -i snyk.json -o results.html
[Error: ENOENT: no such file or directory, open '/Users/will/workspaces/index.js'] {
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: '/Users/will/workspaces/index.js'
}
[Error: ENOENT: no such file or directory, open '/Users/will/workspaces/index.js'] {
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: '/Users/will/workspaces/index.js'
}
[Error: ENOENT: no such file or directory, open '/Users/will/workspaces/index.js'] {
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: '/Users/will/workspaces/index.js'
}
[Error: ENOENT: no such file or directory, open '/Users/will/workspaces/index.js'] {
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: '/Users/will/workspaces/index.js'
}
Vulnerability snapshot saved at results.html
Expected/Desired Behavior
Bug Report - Errors aren't displayed on handled exceptions.
Support Request - HTML output doesn't include invalid code snippets. (Without the need for custom templates)
Feature Request - Option to specify the uriBaseId referenced in the SARIF output as %SRCROOT%
The text was updated successfully, but these errors were encountered:
WillBartee
changed the title
Code snippets parsed incorrectly and throw errors when not running in project directory
Not running in project directory causes errors to be printed and code snippets parsed incorrectly
May 10, 2022
Current Behavior
Multiple errors are printed to the console for each vulnerability when running
snyk-to-html
outside of the scanned projects root directory and using the output ofsnyk code test...
.In addition to the errors, the "Data Flow" portion of the resulting HTML does not correctly display the vulnerable code.
Tested versions
How to Reproduce
Example Output
Expected/Desired Behavior
uriBaseId
referenced in the SARIF output as%SRCROOT%
The text was updated successfully, but these errors were encountered: