Код: Выделить всё
% snyk code test
Testing /mydir ...
✗ [High] Cross-Site Request Forgery (CSRF)
Path: src/com/xxx/ConfigSecurity.java, line 22
Info: CSRF protection is disabled by disable. This allows the attackers to execute requests on a user's behalf.
✔ Test completed
Я получил идентификатор уязвимости:
Код: Выделить всё
% snyk code test --json
Код: Выделить всё
{
"$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json",
"version": "2.1.0",
"runs": [
{
"tool": {
"driver": {
"name": "SnykCode",
"semanticVersion": "1.0.0",
"version": "1.0.0",
"rules": [
{
==> "id": "java/DisablesCSRFProtection",
"name": "DisablesCSRFProtection",
...
Код: Выделить всё
% snyk ignore --id=java/DisablesCSRFProtection
Код: Выделить всё
# Snyk (https://snyk.io) policy file, patches or ignores known vulnerabilities.
version: v1.25.0
# ignores vulnerabilities until expiry date; change duration by modifying expiry date
ignore:
java/DisablesCSRFProtection:
- '*':
reason: None Given
expires: 2022-07-24T11:41:53.787Z
created: 2022-06-24T11:41:53.791Z
patch: {}
Код: Выделить всё
% snyk code test
Testing /Users/sergiostateri/projects/payment-notification-relay ...
✗ [High] Cross-Site Request Forgery (CSRF)
Path: src/main/java/com/xxx/ConfigSecurity.java, line 22
Info: CSRF protection is disabled by disable. This allows the attackers to execute requests on a user's behalf.
✔ Test completed
Organization: customer-retention
Test type: Static code analysis
Project path: /Users/sergiostateri/projects/payment-notification-relay
1 Code issues found
1 [High]
Подробнее здесь: https://stackoverflow.com/questions/727 ... cific-file
Мобильная версия