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

re add bugs #5

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

re add bugs #5

wants to merge 3 commits into from

Conversation

PavelLinearB
Copy link
Member

@PavelLinearB PavelLinearB commented May 9, 2023

workerB

  • used genAi

Copy link

@jit-ci jit-ci bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ Jit has detected 1 important finding in this PR that you should review.
The finding is detailed below as a comment.
It’s highly recommended that you fix this security issue before merge.

introduction/views.py Show resolved Hide resolved
introduction/views.py Fixed Show fixed Hide fixed
@@ -210,6 +210,11 @@
# @authentication_decorator
@csrf_exempt
def mitre_lab_25_api(request):
if request.method == "POST":
expression = request.POST.get('expression')
result = eval(expression)

Check failure

Code scanning / SonarCloud

Dynamic code execution should not be vulnerable to injection attacks

<!--SONAR_ISSUE_KEY:AYgAsTtYOS9Mz-alJxJl-->Change this code to not dynamically execute code influenced by user-controlled data. <p>See more on <a href="https://sonarcloud.io/project/issues?id=linear-b_pygoat&issues=AYgAsTtYOS9Mz-alJxJl&open=AYgAsTtYOS9Mz-alJxJl&pullRequest=5">SonarCloud</a></p>
Copy link
Member Author

@PavelLinearB PavelLinearB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

review comment

Copy link
Member Author

@PavelLinearB PavelLinearB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

review finished

@@ -21,6 +21,9 @@ COPY requirements.txt requirements.txt
RUN pip install --no-cache-dir -r requirements.txt


# copy project
COPY . /app/
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line comment #1 - review started

@@ -210,6 +210,11 @@ def csrf_transfer_monei_api(request,recipent,amount):
# @authentication_decorator
@csrf_exempt
def mitre_lab_25_api(request):
if request.method == "POST":
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line comment 2

Copy link

@jit-ci jit-ci bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ Jit has detected 1 important finding in this PR that you should review.
The finding is detailed as a comment.
It’s highly recommended that you fix this security issue before merge.

Until now, you ignored/fixed 1 finding.

introduction/views.py Show resolved Hide resolved
introduction/views.py Fixed Show fixed Hide fixed
Copy link

@jit-ci jit-ci bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ Jit has detected 2 important findings in this PR that you should review.
The findings are detailed as separate comments.
It’s highly recommended that you fix these security issues before merge.

Until now, you ignored/fixed 1 finding.

@@ -156,7 +156,8 @@
print(sql_query)
try:
print("\nin try\n")
val=""
val=login.objects.raw(sql_query)
val=login.objects.raw(sql_query)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Security control: Static Code Analysis Python Semgrep

Type: Gitlab.Bandit.B611

Description: You should be very careful whenever you write raw SQL. Consider using Django ORM before raw SQL. See https://docs.djangoproject.com/en/3.0/topics/db/sql/#passing-parameters-into-raw

Severity: HIGH

Learn more about this issue


Jit Bot commands and options (e.g., ignore issue)

You can trigger Jit actions by commenting on this PR review:

  • #jit_ignore_fp Ignore and mark this specific single instance of finding as “False Positive”
  • #jit_ignore_accept Ignore and mark this specific single instance of finding as “Accept Risk”
  • #jit_undo_ignore Undo ignore command

val=""
val=login.objects.raw(sql_query)
val=login.objects.raw(sql_query)
val=login.objects.raw(sql_query)

Check failure

Code scanning / SonarCloud

Database queries should not be vulnerable to injection attacks

<!--SONAR_ISSUE_KEY:AYg9L01BCVMcWTPnm_80-->Change this code to not construct SQL queries directly from user-controlled data. <p>See more on <a href="https://sonarcloud.io/project/issues?id=linear-b_pygoat&issues=AYg9L01BCVMcWTPnm_80&open=AYg9L01BCVMcWTPnm_80&pullRequest=5">SonarCloud</a></p>
Copy link

@orca-security-us orca-security-us bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Orca Security Scan Summary

Status Check Issues by priority
passed Passed Infrastructure as Code high 0  medium 0  low 0  info 0
passed Passed Vulnerabilities high 0  medium 0  low 0  info 0
passed Passed Secrets high 0  medium 0  low 0  info 0

@linear-b linear-b deleted a comment from gitstream-cm bot Jun 6, 2023
@linear-b linear-b deleted a comment from gitstream-cm bot Jun 6, 2023
@linear-b linear-b deleted a comment from gitstream-cm bot Jun 6, 2023
@linear-b linear-b deleted a comment from gitstream-cm bot Jun 6, 2023
@linear-b linear-b deleted a comment from gitstream-cm bot Jun 6, 2023
Copy link

@jit-ci jit-ci bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ Jit has detected 3 important findings in this PR that you should review.
The findings are detailed as separate comments.
It’s highly recommended that you fix these security issues before merge.

Until now, you ignored/fixed 7 findings.

@@ -156,7 +156,9 @@ def sql_lab(request):
print(sql_query)
try:
print("\nin try\n")
val=""
val=login.objects.raw(sql_query)
val=login.objects.raw(sql_query)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Security control: Static Code Analysis Python Semgrep

Type: Gitlab.Bandit.B611

Description: You should be very careful whenever you write raw SQL. Consider using Django ORM before raw SQL. See https://docs.djangoproject.com/en/3.0/topics/db/sql/#passing-parameters-into-raw

Severity: HIGH

Learn more about this issue


Jit Bot commands and options (e.g., ignore issue)

You can trigger Jit actions by commenting on this PR review:

  • #jit_ignore_fp Ignore and mark this specific single instance of finding as “False Positive”
  • #jit_ignore_accept Ignore and mark this specific single instance of finding as “Accept Risk”
  • #jit_undo_ignore Undo ignore command

val=""
val=login.objects.raw(sql_query)
val=login.objects.raw(sql_query)
val=login.objects.raw(sql_query)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Security control: Static Code Analysis Python Semgrep

Type: Gitlab.Bandit.B611

Description: You should be very careful whenever you write raw SQL. Consider using Django ORM before raw SQL. See https://docs.djangoproject.com/en/3.0/topics/db/sql/#passing-parameters-into-raw

Severity: HIGH

Learn more about this issue


Jit Bot commands and options (e.g., ignore issue)

You can trigger Jit actions by commenting on this PR review:

  • #jit_ignore_fp Ignore and mark this specific single instance of finding as “False Positive”
  • #jit_ignore_accept Ignore and mark this specific single instance of finding as “Accept Risk”
  • #jit_undo_ignore Undo ignore command

@@ -156,7 +156,9 @@ def sql_lab(request):
print(sql_query)
try:
print("\nin try\n")
val=""
val=login.objects.raw(sql_query)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Security control: Static Code Analysis Python Semgrep

Type: Gitlab.Bandit.B611

Description: You should be very careful whenever you write raw SQL. Consider using Django ORM before raw SQL. See https://docs.djangoproject.com/en/3.0/topics/db/sql/#passing-parameters-into-raw

Severity: HIGH

Learn more about this issue


Jit Bot commands and options (e.g., ignore issue)

You can trigger Jit actions by commenting on this PR review:

  • #jit_ignore_fp Ignore and mark this specific single instance of finding as “False Positive”
  • #jit_ignore_accept Ignore and mark this specific single instance of finding as “Accept Risk”
  • #jit_undo_ignore Undo ignore command

Copy link

@jit-ci jit-ci bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ Jit has detected 3 important findings in this PR that you should review.
The findings are detailed as separate comments.
It’s highly recommended that you fix these security issues before merge.

Until now, you ignored/fixed 10 findings.

@@ -156,7 +156,9 @@ def sql_lab(request):
print(sql_query)
try:
print("\nin try\n")
val=""
val=login.objects.raw(sql_query)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Security control: Static Code Analysis Python Semgrep

Type: Gitlab.Bandit.B611

Description: You should be very careful whenever you write raw SQL. Consider using Django ORM before raw SQL. See https://docs.djangoproject.com/en/3.0/topics/db/sql/#passing-parameters-into-raw

Severity: HIGH

Learn more about this issue


Jit Bot commands and options (e.g., ignore issue)

You can trigger Jit actions by commenting on this PR review:

  • #jit_ignore_fp Ignore and mark this specific single instance of finding as “False Positive”
  • #jit_ignore_accept Ignore and mark this specific single instance of finding as “Accept Risk”
  • #jit_undo_ignore Undo ignore command

@@ -156,7 +156,9 @@
print(sql_query)
try:
print("\nin try\n")
val=""
val=login.objects.raw(sql_query)
val=login.objects.raw(sql_query)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Security control: Static Code Analysis Python Semgrep

Type: Gitlab.Bandit.B611

Description: You should be very careful whenever you write raw SQL. Consider using Django ORM before raw SQL. See https://docs.djangoproject.com/en/3.0/topics/db/sql/#passing-parameters-into-raw

Severity: HIGH

Learn more about this issue


Jit Bot commands and options (e.g., ignore issue)

You can trigger Jit actions by commenting on this PR review:

  • #jit_ignore_fp Ignore and mark this specific single instance of finding as “False Positive”
  • #jit_ignore_accept Ignore and mark this specific single instance of finding as “Accept Risk”
  • #jit_undo_ignore Undo ignore command

val=""
val=login.objects.raw(sql_query)
val=login.objects.raw(sql_query)
val=login.objects.raw(sql_query)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Security control: Static Code Analysis Python Semgrep

Type: Gitlab.Bandit.B611

Description: You should be very careful whenever you write raw SQL. Consider using Django ORM before raw SQL. See https://docs.djangoproject.com/en/3.0/topics/db/sql/#passing-parameters-into-raw

Severity: HIGH

Learn more about this issue


Jit Bot commands and options (e.g., ignore issue)

You can trigger Jit actions by commenting on this PR review:

  • #jit_ignore_fp Ignore and mark this specific single instance of finding as “False Positive”
  • #jit_ignore_accept Ignore and mark this specific single instance of finding as “Accept Risk”
  • #jit_undo_ignore Undo ignore command

@gitstream-cm
Copy link

gitstream-cm bot commented Jun 6, 2023

comments: [{"commenter":"sonarcloud","content":"SonarCloud Quality Gate failed.    Quality Gate failed\n\nBug C 6 Bugs \nVulnerability E 4 Vulnerabilities \nSecurity Hotspot E 1 Security Hotspot \nCode Smell A 3 Code Smells\n\nNo Coverage information No Coverage information \n0.0% 0.0% Duplication\n\n","created_at":"2023-06-06T12:17:52Z","id":1578655379}]

@sonarcloud
Copy link

sonarcloud bot commented Jun 6, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug C 6 Bugs
Vulnerability E 4 Vulnerabilities
Security Hotspot E 1 Security Hotspot
Code Smell A 3 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant