Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge main into dev #128

Merged
merged 51 commits into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
28e426a
bug: fix #74 and semgrep issues
mpast Jan 2, 2023
1a0f366
Merge pull request #82 from mpast/bug-fix-issues
mpast Jan 2, 2023
b1b609c
fix: requirements.txt to reduce vulnerabilities
snyk-bot Feb 2, 2023
ba5e3f1
Merge pull request #83 from mpast/snyk-fix-f7aea06111fe91af441286bbba…
mpast Feb 3, 2023
4820f6f
fix: requirements.txt to reduce vulnerabilities
snyk-bot Feb 11, 2023
508ed11
fix: requirements.txt to reduce vulnerabilities
snyk-bot Feb 14, 2023
bdf8ef4
Merge pull request #85 from mpast/snyk-fix-4aa68a132f0ddbc56111dcef2f…
mpast Feb 15, 2023
13020e2
Merge pull request #84 from mpast/snyk-fix-ee4a5b3fd729e36df442a05ebd…
mpast Feb 15, 2023
d62b6ec
fix: requirements.txt to reduce vulnerabilities
snyk-bot Feb 19, 2023
db3503b
Merge pull request #86 from mpast/snyk-fix-c672d7dc95a7405cd5ebb2c8bf…
mpast Feb 19, 2023
c7da64b
fix: requirements.txt to reduce vulnerabilities
snyk-bot Feb 19, 2023
966cb82
Merge pull request #87 from mpast/snyk-fix-6fba875b1afbc20ba2261e0b67…
mpast Feb 20, 2023
71eb6d5
#88 Bug upgrade jadx
mpast Apr 25, 2023
5ad6f57
Merge pull request #89 from mpast/88-upgrade-jadx
mpast Apr 25, 2023
474af3b
fix: requirements.txt to reduce vulnerabilities
snyk-bot May 5, 2023
6032605
Merge pull request #90 from mpast/snyk-fix-da9204620d04c8b44a9e9820da…
mpast May 16, 2023
3eb3480
fix: requirements.txt to reduce vulnerabilities
snyk-bot May 23, 2023
7689a0d
Merge pull request #93 from mpast/snyk-fix-161a50e3c175e6987fab11cad6…
mpast May 23, 2023
1bed76a
fix: requirements.txt to reduce vulnerabilities
snyk-bot Jul 2, 2023
4a61f36
fix: requirements.txt to reduce vulnerabilities
snyk-bot Jul 3, 2023
b4bc028
Merge pull request #94 from mpast/snyk-fix-b27cebc47f295858bcea23fd7d…
mpast Jul 7, 2023
7fc3a32
Merge pull request #95 from mpast/snyk-fix-f1bb5244477901590223fb79c9…
mpast Jul 7, 2023
bbd49fc
build(deps): bump uwsgi from 2.0.19.1 to 2.0.22
dependabot[bot] Aug 24, 2023
6b4cc90
Merge pull request #97 from mpast/dependabot/pip/uwsgi-2.0.22
mpast Aug 31, 2023
3f77987
fix: requirements.txt to reduce vulnerabilities
snyk-bot Sep 26, 2023
0c4accb
Merge pull request #98 from mpast/snyk-fix-66bf475f18cd59f42504a1025e…
mpast Sep 28, 2023
e7f3d69
fix: requirements.txt to reduce vulnerabilities
snyk-bot Sep 28, 2023
9d7145d
fix: requirements.txt to reduce vulnerabilities
snyk-bot Oct 5, 2023
0dbb266
Merge pull request #99 from mpast/snyk-fix-ddf39a6fcb24cf411bdf2d7236…
mpast Oct 19, 2023
25b5523
Merge pull request #100 from mpast/snyk-fix-dadc51d2fe982302645f9043d…
mpast Oct 19, 2023
93b187e
bug: fix #103 server error
Dec 7, 2023
d3a487f
Merge pull request #104 from mpast/bug-fix-server-error
mpast Dec 7, 2023
26bf5df
chore: add rabbitmq logs file to avoid permission issues
Dec 16, 2023
17915b5
Merge pull request #106 from mpast/bug-fix-server-error
mpast Dec 16, 2023
73962e1
chore: upgrade to django 4 and bump dependencies/containers
Mar 9, 2024
77e1b14
chore: upgrade dependencies to avoid vulnerabilities
Mar 9, 2024
25d1124
Merge pull request #116 from mpast/chore-upgrade-django-dependencies
mpast Mar 9, 2024
1ed8259
build(deps): bump django from 4.1.6 to 4.1.13
dependabot[bot] Mar 9, 2024
207abd1
Merge pull request #117 from mpast/dependabot/pip/django-4.1.13
mpast Mar 9, 2024
5d80194
build(deps): bump pillow from 10.2.0 to 10.3.0
dependabot[bot] Apr 3, 2024
de174a5
build(deps): bump idna from 3.6 to 3.7
dependabot[bot] Apr 12, 2024
9923053
fix: requirements.txt to reduce vulnerabilities
snyk-bot Apr 17, 2024
1b63a1f
Merge pull request #122 from mpast/snyk-fix-c033de895afb5133ecf23875d…
mpast Apr 17, 2024
896e5c7
Merge pull request #119 from mpast/dependabot/pip/idna-3.7
mpast Apr 17, 2024
82b8548
Merge pull request #118 from mpast/dependabot/pip/pillow-10.3.0
mpast Apr 17, 2024
771d93b
Update semgrep.yml
mpast Apr 17, 2024
30cfe57
Merge pull request #123 from mpast/chore-update-semgrep-scanning
mpast Apr 17, 2024
a792bd2
build(deps): bump jinja2 from 3.1.3 to 3.1.4
dependabot[bot] May 6, 2024
f66564d
---
dependabot[bot] May 21, 2024
beda31f
Merge pull request #124 from mpast/dependabot/pip/jinja2-3.1.4
mpast May 21, 2024
61b9641
Merge pull request #126 from mpast/dependabot/pip/requests-2.32.0
mpast May 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
SECRET_KEY='akj)aa@2rp+$duf_m$)4!@cc#()h@q(ag0f=h8#1@dlpdouni5'
DEBUG=0
DJANGO_ALLOWED_HOSTS=['web','app','localhost','127.0.0.1']
CSRF_TRUSTED_ORIGINS=['http://localhost','http://localhost:8888','http://127.0.0.1:8888']
ENV=PROD
SQL_ENGINE=django.db.backends.postgresql
SQL_DATABASE=postgres
Expand Down
28 changes: 0 additions & 28 deletions .github/workflows/anchore-analysis.yml

This file was deleted.

24 changes: 12 additions & 12 deletions .github/workflows/semgrep.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,33 @@ name: Semgrep

on:
pull_request_target: {}
workflow_dispatch: {}
push:
branches: ["main"]
# Schedule the CI job (this method uses cron syntax):
branches: ["master", "main"]
schedule:
- cron: '0 0 1 * *' # Sets Semgrep to scan every month
- cron: '30 15 */15 * *' # Sets Semgrep to scan every 15 days.

jobs:
semgrep:
name: Scan
name: semgrep/ci
runs-on: ubuntu-latest

container:
image: returntocorp/semgrep
image: semgrep/semgrep

# Skip any PR created by dependabot to avoid permission issues:
if: (github.actor != 'dependabot[bot]')

steps:
# Fetch project source with GitHub Actions Checkout.
- uses: actions/checkout@v3
# Run the "semgrep ci" command on the command line of the docker image.
- run: semgrep ci --sarif --output=semgrep.sarif
- uses: actions/checkout@v4
- run: semgrep ci --sarif > semgrep.sarif
env:
SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }}
# Upload the results to Github Advanced Security

- name: Upload SARIF file for GitHub Advanced Security Dashboard
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: semgrep.sarif
if: always()




26 changes: 0 additions & 26 deletions .github/workflows/shiftleft-analysis.yml

This file was deleted.

30 changes: 0 additions & 30 deletions .github/workflows/trivy-analysis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
.env
.vscode
app/logs/*
rabbitmq/logs/*
rabbitmq/logs/*.log
nginx/logs/*
app/media/*
*.sqlite3
Expand Down
8 changes: 2 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
FROM python:3.9.16-buster@sha256:5e28891402c02291f65c6652a8abddedcb5af15933e923c07c2670f836243833
FROM python:3.10-bullseye@sha256:02c7cb92b8f23908de6457f7800c93b84ed8c6e7201da7935443d4c5eca7b381

# Update and package installation
RUN apt-get update && \
apt-get clean && \
apt-get install -y ca-certificates-java --no-install-recommends && \
apt-get clean

RUN apt-get update && \
apt-get install -y openjdk-11-jdk p11-kit wkhtmltopdf libqt5gui5 && \
apt-get install -y && \
apt-get clean && \
update-ca-certificates -f

# Get JADX Tool
ENV JADX_VERSION 1.4.5
ENV JADX_VERSION 1.4.7

RUN \
wget "https://github.com/skylot/jadx/releases/download/v$JADX_VERSION/jadx-$JADX_VERSION.zip" && \
Expand Down
4 changes: 1 addition & 3 deletions app/config/settings.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import os
import logging
from getenv import env

BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
Expand Down Expand Up @@ -65,6 +64,7 @@
DEBUG = int(env("DEBUG", 0))

ALLOWED_HOSTS = tuple(env("DJANGO_ALLOWED_HOSTS", ['web','app','localhost','127.0.0.1']))
CSRF_TRUSTED_ORIGINS=tuple(env("CSRF_TRUSTED_ORIGINS", ['http://web','http://app','http://localhost','http://127.0.0.1']))

# Database
# https://docs.djangoproject.com/en/3.0/ref/settings/#databases
Expand Down Expand Up @@ -140,8 +140,6 @@

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True
Expand Down
10 changes: 4 additions & 6 deletions app/config/urls.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
from django.contrib import admin
from django.urls import path, include
from django.urls import path, include, re_path
from app import views, api
from django.conf.urls import url
from rest_framework import routers
from rest_framework.authtoken.views import obtain_auth_token
from rest_framework import permissions
from drf_yasg.views import get_schema_view
from drf_yasg import openapi
from app.worker.tasks import scan_state
Expand Down Expand Up @@ -58,8 +56,8 @@
path('api/v1/auth-token/', obtain_auth_token, name='api_token_auth'),
path('api/v1/', include(router.urls)),
path('scan_state/<int:id>', scan_state, name="scan_state"),
url(r'^swagger(?P<format>\.json|\.yaml)$', schema_view.without_ui(cache_timeout=0), name='schema-json'),
url(r'^swagger/$', schema_view.with_ui('swagger', cache_timeout=0), name='schema-swagger-ui'),
url(r'^redoc/$', schema_view.with_ui('redoc', cache_timeout=0), name='schema-redoc'),
re_path(r'^swagger(?P<format>\.json|\.yaml)$', schema_view.without_ui(cache_timeout=0), name='schema-json'),
re_path(r'^swagger/$', schema_view.with_ui('swagger', cache_timeout=0), name='schema-swagger-ui'),
re_path(r'^redoc/$', schema_view.with_ui('redoc', cache_timeout=0), name='schema-redoc'),

]
2 changes: 1 addition & 1 deletion app/templates/app.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ <h5>Scans</h5>
{% else %}
<td> {% fa5_icon 'shield-alt' color='green' %} {{ scan_data.antivirus.malicious }}</td>
{% endif %} {% endif %}
<td><a href="{% url 'findings' scan_id=scan.id %}" target="_blank">{{ scan.findings }}</a></td>
<td><a href="{% url 'findings' scan_id=scan.id %}" target="_blank" rel="noopener noreferrer">{{ scan.findings }}</a></td>
<td>
<table class="table table-borderless">
{% for severity, number in scan_data.findings.items %}
Expand Down
20 changes: 10 additions & 10 deletions app/templates/export.html
Original file line number Diff line number Diff line change
Expand Up @@ -506,17 +506,17 @@
<tbody>
{% for finding in findings_ordered|lookup:id %}
<tr>
<td><a href="{% url 'finding' id=finding.id %}" target="_blank">{{ finding.id }}</a></td>
<td><a href="{% url 'finding' id=finding.id %}" target="_blank" rel="noopener noreferrer">{{ finding.id }}</a></td>
<td>{{ finding.get_severity_display }}</td>
<td><a href="{% url 'finding_view_file' id=finding.id %}" target="_blank">{{ finding.path }}</a></td>
<td><a href="{% url 'finding_view_file' id=finding.id %}#finding" target="_blank">{{ finding.line_number }}</a></td>
<td><a href="{% url 'finding_view_file' id=finding.id %}" target="_blank" rel="noopener noreferrer">{{ finding.path }}</a></td>
<td><a href="{% url 'finding_view_file' id=finding.id %}#finding" target="_blank" rel="noopener noreferrer">{{ finding.line_number }}</a></td>
<td>{{ finding.line }}</td>
<td>{{ finding.get_status_display }}</td>
<td><a href="{{ settings.CWE_URL }}{{ finding.cwe.cwe }}.html" target="_blank">{{ finding.cwe.cwe }} </a></td>
<td><a href="{{ settings.CWE_URL }}{{ finding.cwe.cwe }}.html" target="_blank" rel="noopener noreferrer">{{ finding.cwe.cwe }} </a></td>

Check warning

Code scanning / Semgrep PRO

Semgrep Finding: javascript.express.security.audit.xss.mustache.var-in-href.var-in-href Warning

Detected a template variable used in an anchor tag with the 'href' attribute. This allows a malicious actor to input the 'javascript:' URI and is subject to cross- site scripting (XSS) attacks. If using a relative URL, start with a literal forward slash and concatenate the URL, like this: href='/{link}'. You may also consider setting the Content Security Policy (CSP) header.
{% if settings.DEFECTDOJO_ENABLED %}
<td>
{% if finding.defectdojo_id > 0 %}
<a href="{{ settings.DEFECTDOJO_URL }}{{ finding.defectdojo_id }}" target="_blank">{{ finding.defectdojo_id }}</a> {% else %} <span>N/A</span>{% endif %}
<a href="{{ settings.DEFECTDOJO_URL }}{{ finding.defectdojo_id }}" target="_blank" rel="noopener noreferrer">{{ finding.defectdojo_id }}</a> {% else %} <span>N/A</span>{% endif %}

Check warning

Code scanning / Semgrep PRO

Semgrep Finding: javascript.express.security.audit.xss.mustache.var-in-href.var-in-href Warning

Detected a template variable used in an anchor tag with the 'href' attribute. This allows a malicious actor to input the 'javascript:' URI and is subject to cross- site scripting (XSS) attacks. If using a relative URL, start with a literal forward slash and concatenate the URL, like this: href='/{link}'. You may also consider setting the Content Security Policy (CSP) header.

Check warning

Code scanning / Semgrep PRO

Semgrep Finding: python.django.security.audit.xss.template-href-var.template-href-var Warning

Detected a template variable used in an anchor tag with the 'href' attribute. This allows a malicious actor to input the 'javascript:' URI and is subject to cross- site scripting (XSS) attacks. Use the 'url' template tag to safely generate a URL. You may also consider setting the Content Security Policy (CSP) header.

Check warning

Code scanning / Semgrep PRO

Semgrep Finding: python.flask.security.xss.audit.template-href-var.template-href-var Warning

Detected a template variable used in an anchor tag with the 'href' attribute. This allows a malicious actor to input the 'javascript:' URI and is subject to cross- site scripting (XSS) attacks. Use 'url_for()' to safely generate a URL. You may also consider setting the Content Security Policy (CSP) header.
</td>
{% endif %}
</tr>
Expand Down Expand Up @@ -563,9 +563,9 @@
<tbody>
{% for finding in best_practices %} {% if finding.type.id == practice.id %}
<tr>
<td><a href="{% url 'finding' id=finding.id %}" target="_blank">{{ finding.id }}</a></td>
<td><a href="{% url 'finding_view_file' id=finding.id %}" target="_blank">{{ finding.path }}</a></td>
<td><a href="{% url 'finding_view_file' id=finding.id %}#finding" target="_blank">{{ finding.line_number }}</a></td>
<td><a href="{% url 'finding' id=finding.id %}" target="_blank" rel="noopener noreferrer">{{ finding.id }}</a></td>
<td><a href="{% url 'finding_view_file' id=finding.id %}" target="_blank" rel="noopener noreferrer">{{ finding.path }}</a></td>
<td><a href="{% url 'finding_view_file' id=finding.id %}#finding" target="_blank" rel="noopener noreferrer">{{ finding.line_number }}</a></td>
<td>{{ finding.line }}
</td>
</tr>
Expand Down Expand Up @@ -601,7 +601,7 @@
{% if file.type == 'html' %}
<td>{{ file.name }}</td>
{% else %}
<td><a href="{% url 'view_file' id=file.id %}" target="_blank">{{ file.name }} </a></td>
<td><a href="{% url 'view_file' id=file.id %}" target="_blank" rel="noopener noreferrer">{{ file.name }} </a></td>
{% endif %}
<td>{{ file.type }} </td>
</tr>
Expand Down Expand Up @@ -632,7 +632,7 @@
<td>{{ string.id }}</td>
<td>{{ string.type }} </td>
<td>{{ string.value }} </td>
<td><a href="{% url 'finding' id=string.finding.id %}" target="_blank">{{ string.finding.id }}</a></td>
<td><a href="{% url 'finding' id=string.finding.id %}" target="_blank" rel="noopener noreferrer">{{ string.finding.id }}</a></td>
</tr>
{% endfor %}
</tbody>
Expand Down
6 changes: 3 additions & 3 deletions app/templates/finding.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
</tr>
<tr>
<th>CWE</th>
<td><a class="link" href="{{ settings.CWE_URL }}{{finding.cwe.cwe}}.html" target="_blank">{{ finding.cwe.cwe }} </a></td>
<td><a class="link" href="{{ settings.CWE_URL }}{{finding.cwe.cwe}}.html" target="_blank" rel="noopener noreferrer">{{ finding.cwe.cwe }} </a></td>

Check warning

Code scanning / Semgrep PRO

Semgrep Finding: javascript.express.security.audit.xss.mustache.var-in-href.var-in-href Warning

Detected a template variable used in an anchor tag with the 'href' attribute. This allows a malicious actor to input the 'javascript:' URI and is subject to cross- site scripting (XSS) attacks. If using a relative URL, start with a literal forward slash and concatenate the URL, like this: href='/{link}'. You may also consider setting the Content Security Policy (CSP) header.
</tr>
<tr>
<th>OWASP TOP 10 Mobile Risk</th>
<td><a class="link" href="{{ pattern.default_risk.reference }}" target="_blank">M{{ pattern.default_risk.risk }} </a></td>
<td><a class="link" href="{{ pattern.default_risk.reference }}" target="_blank" rel="noopener noreferrer">M{{ pattern.default_risk.risk }} </a></td>

Check warning

Code scanning / Semgrep PRO

Semgrep Finding: javascript.express.security.audit.xss.mustache.var-in-href.var-in-href Warning

Detected a template variable used in an anchor tag with the 'href' attribute. This allows a malicious actor to input the 'javascript:' URI and is subject to cross- site scripting (XSS) attacks. If using a relative URL, start with a literal forward slash and concatenate the URL, like this: href='/{link}'. You may also consider setting the Content Security Policy (CSP) header.

Check warning

Code scanning / Semgrep PRO

Semgrep Finding: python.django.security.audit.xss.template-href-var.template-href-var Warning

Detected a template variable used in an anchor tag with the 'href' attribute. This allows a malicious actor to input the 'javascript:' URI and is subject to cross- site scripting (XSS) attacks. Use the 'url' template tag to safely generate a URL. You may also consider setting the Content Security Policy (CSP) header.

Check warning

Code scanning / Semgrep PRO

Semgrep Finding: python.flask.security.xss.audit.template-href-var.template-href-var Warning

Detected a template variable used in an anchor tag with the 'href' attribute. This allows a malicious actor to input the 'javascript:' URI and is subject to cross- site scripting (XSS) attacks. Use 'url_for()' to safely generate a URL. You may also consider setting the Content Security Policy (CSP) header.
</tr>
<tr>
<th>Finding</th>
Expand Down Expand Up @@ -55,6 +55,6 @@
</tr>
</table>
{% if settings.DEFECTDOJO_ENABLED and finding.defectdojo_id > 0 %}
<a href="{{ settings.DEFECTDOJO_URL }}{{ finding.defectdojo_id }}" target="_blank" class="btn btn-outline-dark">DefectDojo{% fa5_icon 'external-link-alt' %}</a> {% endif %}
<a href="{{ settings.DEFECTDOJO_URL }}{{ finding.defectdojo_id }}" target="_blank" rel="noopener noreferrer" class="btn btn-outline-dark">DefectDojo{% fa5_icon 'external-link-alt' %}</a> {% endif %}

Check warning

Code scanning / Semgrep PRO

Semgrep Finding: javascript.express.security.audit.xss.mustache.var-in-href.var-in-href Warning

Detected a template variable used in an anchor tag with the 'href' attribute. This allows a malicious actor to input the 'javascript:' URI and is subject to cross- site scripting (XSS) attacks. If using a relative URL, start with a literal forward slash and concatenate the URL, like this: href='/{link}'. You may also consider setting the Content Security Policy (CSP) header.

Check warning

Code scanning / Semgrep PRO

Semgrep Finding: python.django.security.audit.xss.template-href-var.template-href-var Warning

Detected a template variable used in an anchor tag with the 'href' attribute. This allows a malicious actor to input the 'javascript:' URI and is subject to cross- site scripting (XSS) attacks. Use the 'url' template tag to safely generate a URL. You may also consider setting the Content Security Policy (CSP) header.

Check warning

Code scanning / Semgrep PRO

Semgrep Finding: python.flask.security.xss.audit.template-href-var.template-href-var Warning

Detected a template variable used in an anchor tag with the 'href' attribute. This allows a malicious actor to input the 'javascript:' URI and is subject to cross- site scripting (XSS) attacks. Use 'url_for()' to safely generate a URL. You may also consider setting the Content Security Policy (CSP) header.

<a class="btn btn-outline-danger" href="{% url 'edit_finding' id=finding.id %}">Edit</a> {% endblock %}
12 changes: 6 additions & 6 deletions app/templates/findings.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,19 +57,19 @@
{% for finding in findings %}
<tr>
<td><input id="{{ finding.id }}" class="finding" name="{{ finding.id }}" type="checkbox" /></td>
<td><a class="btn btn-outline-success btn-round" href="{% url 'finding' id=finding.id %}" target="_blank">{{ finding.id }}</a></td>
<td><a class="btn btn-outline-success btn-round" href="{% url 'finding' id=finding.id %}" target="_blank" rel="noopener noreferrer">{{ finding.id }}</a></td>
<td>{{ finding.name }}</td>
<td>{{ finding.get_severity_display }}</td>
<td><a class="link" href="{% url 'finding_view_file' id=finding.id %}" target="_blank">{{ finding.path }}</a></td>
<td><a class="link" href="{% url 'finding_view_file' id=finding.id %}#finding" target="_blank">{{ finding.line_number }}</a></td>
<td><a class="link" href="{% url 'finding_view_file' id=finding.id %}" target="_blank" rel="noopener noreferrer">{{ finding.path }}</a></td>
<td><a class="link" href="{% url 'finding_view_file' id=finding.id %}#finding" target="_blank" rel="noopener noreferrer">{{ finding.line_number }}</a></td>
<td>{{ finding.line }}</td>
<td>{{ finding.get_status_display }}</td>
<td><a class="link" href="{{ settings.CWE_URL }}{{ finding.cwe.cwe }}.html" target="_blank">{{ finding.cwe.cwe }} </a></td>
<td><a class="link" href="{{ pattern.default_risk.reference }}" target="_blank">M{{ pattern.default_risk.risk }} </a></td>
<td><a class="link" href="{{ settings.CWE_URL }}{{ finding.cwe.cwe }}.html" target="_blank" rel="noopener noreferrer">{{ finding.cwe.cwe }} </a></td>

Check warning

Code scanning / Semgrep PRO

Semgrep Finding: javascript.express.security.audit.xss.mustache.var-in-href.var-in-href Warning

Detected a template variable used in an anchor tag with the 'href' attribute. This allows a malicious actor to input the 'javascript:' URI and is subject to cross- site scripting (XSS) attacks. If using a relative URL, start with a literal forward slash and concatenate the URL, like this: href='/{link}'. You may also consider setting the Content Security Policy (CSP) header.
<td><a class="link" href="{{ pattern.default_risk.reference }}" target="_blank" rel="noopener noreferrer">M{{ pattern.default_risk.risk }} </a></td>

Check warning

Code scanning / Semgrep PRO

Semgrep Finding: javascript.express.security.audit.xss.mustache.var-in-href.var-in-href Warning

Detected a template variable used in an anchor tag with the 'href' attribute. This allows a malicious actor to input the 'javascript:' URI and is subject to cross- site scripting (XSS) attacks. If using a relative URL, start with a literal forward slash and concatenate the URL, like this: href='/{link}'. You may also consider setting the Content Security Policy (CSP) header.

Check warning

Code scanning / Semgrep PRO

Semgrep Finding: python.django.security.audit.xss.template-href-var.template-href-var Warning

Detected a template variable used in an anchor tag with the 'href' attribute. This allows a malicious actor to input the 'javascript:' URI and is subject to cross- site scripting (XSS) attacks. Use the 'url' template tag to safely generate a URL. You may also consider setting the Content Security Policy (CSP) header.

Check warning

Code scanning / Semgrep PRO

Semgrep Finding: python.flask.security.xss.audit.template-href-var.template-href-var Warning

Detected a template variable used in an anchor tag with the 'href' attribute. This allows a malicious actor to input the 'javascript:' URI and is subject to cross- site scripting (XSS) attacks. Use 'url_for()' to safely generate a URL. You may also consider setting the Content Security Policy (CSP) header.
{% if settings.DEFECTDOJO_ENABLED %}
<td>
{% if finding.defectdojo_id > 0 %}
<a href="{{ settings.DEFECTDOJO_URL }}{{ finding.defectdojo_id }}" target="_blank">{{ finding.defectdojo_id }}</a> {% else %} <span>'N/A'</span>{% endif %}
<a href="{{ settings.DEFECTDOJO_URL }}{{ finding.defectdojo_id }}" target="_blank" rel="noopener noreferrer">{{ finding.defectdojo_id }}</a> {% else %} <span>'N/A'</span>{% endif %}

Check warning

Code scanning / Semgrep PRO

Semgrep Finding: javascript.express.security.audit.xss.mustache.var-in-href.var-in-href Warning

Detected a template variable used in an anchor tag with the 'href' attribute. This allows a malicious actor to input the 'javascript:' URI and is subject to cross- site scripting (XSS) attacks. If using a relative URL, start with a literal forward slash and concatenate the URL, like this: href='/{link}'. You may also consider setting the Content Security Policy (CSP) header.

Check warning

Code scanning / Semgrep PRO

Semgrep Finding: python.django.security.audit.xss.template-href-var.template-href-var Warning

Detected a template variable used in an anchor tag with the 'href' attribute. This allows a malicious actor to input the 'javascript:' URI and is subject to cross- site scripting (XSS) attacks. Use the 'url' template tag to safely generate a URL. You may also consider setting the Content Security Policy (CSP) header.

Check warning

Code scanning / Semgrep PRO

Semgrep Finding: python.flask.security.xss.audit.template-href-var.template-href-var Warning

Detected a template variable used in an anchor tag with the 'href' attribute. This allows a malicious actor to input the 'javascript:' URI and is subject to cross- site scripting (XSS) attacks. Use 'url_for()' to safely generate a URL. You may also consider setting the Content Security Policy (CSP) header.
</td>
{% endif %}
</tr>
Expand Down
2 changes: 1 addition & 1 deletion app/templates/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ <h5>Apps</h5>
{% else %}
<td> {% fa5_icon 'shield-alt' color='green' %} {{ scan_data.antivirus.malicious }}</td>
{% endif %} {% endif %}
<td><a href="{% url 'findings' scan_id=scan.id %}" target="_blank">{{ scan.findings }}</a></td>
<td><a href="{% url 'findings' scan_id=scan.id %}" target="_blank" rel="noopener noreferrer">{{ scan.findings }}</a></td>
<td>
<table class="table table-borderless">
{% for severity, number in scan_data.findings.items %}
Expand Down
4 changes: 2 additions & 2 deletions app/templates/patterns.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@
<td>No</td>
<td>{% fa5_icon 'exclamation-circle' color='red' %}</td>
{% endif %}
<td><a class="link" href="https://cwe.mitre.org/data/definitions/{{finding.cwe.cwe}}.html" target="_blank">{{ pattern.default_cwe.cwe }} </a></td>
<td><a class="link" href="{{ pattern.default_risk.reference }}" target="_blank">M{{ pattern.default_risk.risk }} </a></td>
<td><a class="link" href="https://cwe.mitre.org/data/definitions/{{finding.cwe.cwe}}.html" target="_blank" rel="noopener noreferrer">{{ pattern.default_cwe.cwe }} </a></td>
<td><a class="link" href="{{ pattern.default_risk.reference }}" target="_blank" rel="noopener noreferrer">M{{ pattern.default_risk.risk }} </a></td>

Check warning

Code scanning / Semgrep PRO

Semgrep Finding: javascript.express.security.audit.xss.mustache.var-in-href.var-in-href Warning

Detected a template variable used in an anchor tag with the 'href' attribute. This allows a malicious actor to input the 'javascript:' URI and is subject to cross- site scripting (XSS) attacks. If using a relative URL, start with a literal forward slash and concatenate the URL, like this: href='/{link}'. You may also consider setting the Content Security Policy (CSP) header.

Check warning

Code scanning / Semgrep PRO

Semgrep Finding: python.django.security.audit.xss.template-href-var.template-href-var Warning

Detected a template variable used in an anchor tag with the 'href' attribute. This allows a malicious actor to input the 'javascript:' URI and is subject to cross- site scripting (XSS) attacks. Use the 'url' template tag to safely generate a URL. You may also consider setting the Content Security Policy (CSP) header.

Check warning

Code scanning / Semgrep PRO

Semgrep Finding: python.flask.security.xss.audit.template-href-var.template-href-var Warning

Detected a template variable used in an anchor tag with the 'href' attribute. This allows a malicious actor to input the 'javascript:' URI and is subject to cross- site scripting (XSS) attacks. Use 'url_for()' to safely generate a URL. You may also consider setting the Content Security Policy (CSP) header.
</tr>
{% endfor %}
</tbody>
Expand Down
Loading
Loading