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
Copy file name to clipboardExpand all lines: dojo/fixtures/dojo_testdata.json
+320Lines changed: 320 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -3071,5 +3071,325 @@
3071
3071
"note": null,
3072
3072
"owner": 6
3073
3073
}
3074
+
},
3075
+
{
3076
+
"model": "dojo.test_type",
3077
+
"pk": 1000,
3078
+
"fields": {
3079
+
"name": "SonarQube Scan detailed",
3080
+
"static_tool": false,
3081
+
"dynamic_tool": false,
3082
+
"active": true,
3083
+
"dynamically_generated": false
3084
+
}
3085
+
},
3086
+
{
3087
+
"model": "dojo.test",
3088
+
"pk": 90,
3089
+
"fields": {
3090
+
"engagement": 5,
3091
+
"lead": [
3092
+
"admin"
3093
+
],
3094
+
"test_type": 1000,
3095
+
"scan_type": "SonarQube Scan detailed",
3096
+
"title": null,
3097
+
"description": null,
3098
+
"target_start": "2025-10-22T08:29:41.333Z",
3099
+
"target_end": "2025-10-22T08:29:41.333Z",
3100
+
"percent_complete": 100,
3101
+
"environment": 1,
3102
+
"updated": "2025-10-22T08:29:41.590Z",
3103
+
"created": "2025-10-22T08:29:41.343Z",
3104
+
"version": "",
3105
+
"build_id": "",
3106
+
"commit_hash": "",
3107
+
"branch_tag": "",
3108
+
"api_scan_configuration": null,
3109
+
"notes": [],
3110
+
"files": [],
3111
+
"tags": [],
3112
+
"inherited_tags": []
3113
+
}
3114
+
},
3115
+
{
3116
+
"model": "dojo.finding",
3117
+
"pk": 232,
3118
+
"fields": {
3119
+
"title": "Disabling CSRF Protections Is Security-Sensitive",
3120
+
"date": "2025-10-22",
3121
+
"sla_start_date": null,
3122
+
"sla_expiration_date": "2025-11-21",
3123
+
"cwe": 352,
3124
+
"cve": null,
3125
+
"epss_score": null,
3126
+
"epss_percentile": null,
3127
+
"known_exploited": false,
3128
+
"ransomware_used": false,
3129
+
"kev_date": null,
3130
+
"cvssv3": null,
3131
+
"cvssv3_score": null,
3132
+
"cvssv4": null,
3133
+
"cvssv4_score": null,
3134
+
"url": null,
3135
+
"severity": "High",
3136
+
"description": "A cross-site request forgery (CSRF) attack occurs when a trusted user of a web application can be forced, by an attacker, to perform sensitive\nactions that he didn’t intend, such as updating his profile or sending a message, more generally anything that can change the state of the\napplication.\nThe attacker can trick the user/victim to click on a link, corresponding to the privileged action, or to visit a malicious web site that embeds a\nhidden web request and as web browsers automatically include cookies, the actions can be authenticated and sensitive.\n**Ask Yourself Whether**\n\n The web application uses cookies to authenticate users. \n There exist sensitive operations in the web application that can be performed when the user is authenticated. \n The state / resources of the web application can be modified by doing HTTP POST or HTTP DELETE requests for example. \n\nThere is a risk if you answered yes to any of those questions.\n**Recommended Secure Coding Practices**\n\n Protection against CSRF attacks is strongly recommended:\n \n to be activated by default for all unsafe HTTP\n methods. \n implemented, for example, with an unguessable CSRF token \n \n Of course all sensitive operations should not be performed with safe HTTP methods like GET which are designed to be\n used only for information retrieval. \n\n**Sensitive Code Example**\nFor a Django application, the code is sensitive when,\n\n django.middleware.csrf.CsrfViewMiddleware is not used in the Django settings: \n\n\nMIDDLEWARE = [\n 'django.middleware.security.SecurityMiddleware',\n 'django.contrib.sessions.middleware.SessionMiddleware',\n 'django.middleware.common.CommonMiddleware',\n 'django.contrib.auth.middleware.AuthenticationMiddleware',\n 'django.contrib.messages.middleware.MessageMiddleware',\n 'django.middleware.clickjacking.XFrameOptionsMiddleware',\n] # Sensitive: django.middleware.csrf.CsrfViewMiddleware is missing\n\n\n the CSRF protection is disabled on a view: \n\n\n@csrf_exempt # Sensitive\ndef example(request):\n return HttpResponse(\"default\")\n\nFor a Flask application, the code is sensitive when,\n\n the WTF_CSRF_ENABLED setting is set to false: \n\n\napp = Flask(__name__)\napp.config['WTF_CSRF_ENABLED'] = False # Sensitive\n\n\n the application doesn’t use the CSRFProtect module: \n\n\napp = Flask(__name__) # Sensitive: CSRFProtect is missing\n\n@app.route('/')\ndef hello_world():\n return 'Hello, World!'\n\n\n the CSRF protection is disabled on a view: \n\n\napp = Flask(__name__)\ncsrf = CSRFProtect()\ncsrf.init_app(app)\n\n@app.route('/example/', methods=['POST'])\n@csrf.exempt # Sensitive\ndef example():\n return 'example '\n\n\n the CSRF protection is disabled on a form: \n\n\nclass unprotectedForm(FlaskForm):\n class Meta:\n csrf = False # Sensitive\n\n name = TextField('name')\n submit = SubmitField('submit')\n\n**Compliant Solution**\nFor a Django application,\n\n it is recommended to protect all the views with django.middleware.csrf.CsrfViewMiddleware: \n\n\nMIDDLEWARE = [\n 'django.middleware.security.SecurityMiddleware',\n 'django.contrib.sessions.middleware.SessionMiddleware',\n 'django.middleware.common.CommonMiddleware',\n 'django.middleware.csrf.CsrfViewMiddleware', # Compliant\n 'django.contrib.auth.middleware.AuthenticationMiddleware',\n 'django.contrib.messages.middleware.MessageMiddleware',\n 'django.middleware.clickjacking.XFrameOptionsMiddleware',\n]\n\n\n and to not disable the CSRF protection on specific views: \n\n\ndef example(request): # Compliant\n return HttpResponse(\"default\")\n\nFor a Flask application,\n\n the CSRFProtect module should be used (and not disabled further with WTF_CSRF_ENABLED set to false):\n \n\n\napp = Flask(__name__)\ncsrf = CSRFProtect()\ncsrf.init_app(app) # Compliant\n\n\n and it is recommended to not disable the CSRF protection on specific views or forms: \n\n\n@app.route('/example/', methods=['POST']) # Compliant\ndef example():\n return 'example '\n\nclass unprotectedForm(FlaskForm):\n class Meta:\n csrf = True # Compliant\n\n name = TextField('name')\n submit = SubmitField('submit')",
3137
+
"mitigation": "Make sure disabling CSRF protection is safe here.",
3138
+
"fix_available": null,
3139
+
"impact": "No impact provided",
3140
+
"steps_to_reproduce": null,
3141
+
"severity_justification": null,
3142
+
"references": "python:S4502\nunsafe HTTP\n methods\nsafe HTTP\nDjango\nDjango settings\nFlask\nDjango\nFlask\nOWASP Top 10 2021 Category A1\nMITRE, CWE-352\nOWASP Top 10 2017 Category A6\nOWASP: Cross-Site Request Forgery\nSANS Top 25",
0 commit comments