Skip to content

[ AutoFiC ] Security Patch 2025-12-29 - #1

Open
soonnae wants to merge 2 commits into
mainfrom
WHS_VULN_DETEC_1
Open

soonnae wants to merge 2 commits into
mainfrom
WHS_VULN_DETEC_1

Conversation

@soonnae

@soonnae soonnae commented Dec 29, 2025

Copy link
Copy Markdown
Owner

🔧 About This Pull Request

This patch was automatically created by AutoFiC ,
an open-source framework that combines static analysis tools with AI-driven remediation.

Using Semgrep, CodeQL, and Snyk Code, AutoFiC detected potential security flaws and applied verified fixes.
Each patch includes contextual explanations powered by a large language model to support review and decision-making.

🔐 Summary of Security Fixes

Overview

Detected by: SEMGREP

File Total Issues Levels Top CWE(s)
backend/api/users/mutations/reset_password.py 1 W:1 CWE-521
backend/custom_admin/templatetags/admin_custom_index_links.py 1 W:1 CWE-79
backend/files_upload/views.py 1 W:1 CWE-352
backend/google_api/admin.py 1 W:1 CWE-79
backend/grants/admin.py 1 W:1 CWE-79
backend/i18n/forms.py 1 W:1 CWE-79
backend/notifications/admin/admins.py 1 W:1 CWE-79
backend/notifications/rendered_email_template.py 1 W:1 CWE-79
backend/participants/admin.py 2 W:2 CWE-79
backend/reviews/admin.py 3 W:3 CWE-79
backend/schedule/admin.py 2 W:2 CWE-79
backend/users/managers.py 1 W:1 CWE-521
backend/video_uploads/admin.py 1 W:1 CWE-79
backend/visa/admin.py 1 W:1 CWE-79
backend/visa/templatetags/invitation_letter_asset.py 1 W:1 CWE-79

1. backend/api/users/mutations/reset_password.py

🧷 BIT Summary (per line)

Line BIT Level Trigger Step
91 ⚠️ WARNING The password on 'user' is being set without validating the password. Call django.contrib.auth.password_validation.valida… Review line 91 in backend/api/users/mutations/reset_password.py

🧩 SAST Analysis Summary

Line Type Level BIT Level CWE(s) Ref
91 Improper Authentication ⚠️ WARNING ⚠️ WARNING CWE-521 🔗

🧠 BIT Highlights

  • Line 91: Trigger: The password on 'user' is being set without validating the password. Call django.contrib.auth.password_validation.validate_password() with validation functions before setting the p…; Steps: Review line 91 in backend/api/users/mutations/reset_password.py; Repro: Inspect the indicated code region and verify unsafe data flow or pattern.

📎 Further Context

  • References:
  • Preconditions:
    • Authenticated user may be required depending on route.

2. backend/custom_admin/templatetags/admin_custom_index_links.py

🧷 BIT Summary (per line)

Line BIT Level Trigger Step
31 ⚠️ WARNING 'mark_safe()' is used to mark a string as "safe" for HTML output. This disables escaping and could therefore subject the… Review lines 31-43 in backend/custom_admin/templatetags/admin_custom_index_links.py

🧩 SAST Analysis Summary

Line Type Level BIT Level CWE(s) Ref
31~43 Cross-Site-Scripting (XSS) ⚠️ WARNING ⚠️ WARNING CWE-79 🔗

🧠 BIT Highlights

  • Line 31: Trigger: 'mark_safe()' is used to mark a string as "safe" for HTML output. This disables escaping and could therefore subject the content to XSS attacks. Use 'django.utils.html.format_html(…; Steps: Review lines 31-43 in backend/custom_admin/templatetags/admin_custom_index_links.py; Repro: Inspect the indicated code region and verify unsafe data flow or pattern.

📎 Further Context

  • References:
  • Preconditions:
    • Authenticated user may be required depending on route.

3. backend/files_upload/views.py

🧷 BIT Summary (per line)

Line BIT Level Trigger Step
8 ⚠️ WARNING Detected usage of @csrf_exempt, which indicates that there is no CSRF token set for this route. This could lead to an at… Review lines 8-18 in backend/files_upload/views.py

🧩 SAST Analysis Summary

Line Type Level BIT Level CWE(s) Ref
8~18 Cross-Site Request Forgery (CSRF) ⚠️ WARNING ⚠️ WARNING CWE-352 🔗

🧠 BIT Highlights

  • Line 8: Trigger: Detected usage of @csrf_exempt, which indicates that there is no CSRF token set for this route. This could lead to an attacker manipulating the user's account and exfiltration of p…; Steps: Review lines 8-18 in backend/files_upload/views.py; Repro: Inspect the indicated code region and verify unsafe data flow or pattern.

📎 Further Context

  • References:
  • Preconditions:
    • Authenticated user may be required depending on route.

4. backend/google_api/admin.py

🧷 BIT Summary (per line)

Line BIT Level Trigger Step
45 ⚠️ WARNING 'mark_safe()' is used to mark a string as "safe" for HTML output. This disables escaping and could therefore subject the… Review line 45 in backend/google_api/admin.py

🧩 SAST Analysis Summary

Line Type Level BIT Level CWE(s) Ref
45 Cross-Site-Scripting (XSS) ⚠️ WARNING ⚠️ WARNING CWE-79 🔗

🧠 BIT Highlights

  • Line 45: Trigger: 'mark_safe()' is used to mark a string as "safe" for HTML output. This disables escaping and could therefore subject the content to XSS attacks. Use 'django.utils.html.format_html(…; Steps: Review line 45 in backend/google_api/admin.py; Repro: Inspect the indicated code region and verify unsafe data flow or pattern.

📎 Further Context

  • References:
  • Preconditions:
    • Authenticated user may be required depending on route.

5. backend/grants/admin.py

🧷 BIT Summary (per line)

Line BIT Level Trigger Step
702 ⚠️ WARNING 'mark_safe()' is used to mark a string as "safe" for HTML output. This disables escaping and could therefore subject the… Review line 702 in backend/grants/admin.py

🧩 SAST Analysis Summary

Line Type Level BIT Level CWE(s) Ref
702 Cross-Site-Scripting (XSS) ⚠️ WARNING ⚠️ WARNING CWE-79 🔗

🧠 BIT Highlights

  • Line 702: Trigger: 'mark_safe()' is used to mark a string as "safe" for HTML output. This disables escaping and could therefore subject the content to XSS attacks. Use 'django.utils.html.format_html(…; Steps: Review line 702 in backend/grants/admin.py; Repro: Inspect the indicated code region and verify unsafe data flow or pattern.

📎 Further Context

  • References:
  • Preconditions:
    • Authenticated user may be required depending on route.

6. backend/i18n/forms.py

🧷 BIT Summary (per line)

Line BIT Level Trigger Step
132 ⚠️ WARNING 'mark_safe()' is used to mark a string as "safe" for HTML output. This disables escaping and could therefore subject the… Review line 132 in backend/i18n/forms.py

🧩 SAST Analysis Summary

Line Type Level BIT Level CWE(s) Ref
132 Cross-Site-Scripting (XSS) ⚠️ WARNING ⚠️ WARNING CWE-79 🔗

🧠 BIT Highlights

  • Line 132: Trigger: 'mark_safe()' is used to mark a string as "safe" for HTML output. This disables escaping and could therefore subject the content to XSS attacks. Use 'django.utils.html.format_html(…; Steps: Review line 132 in backend/i18n/forms.py; Repro: Inspect the indicated code region and verify unsafe data flow or pattern.

📎 Further Context

  • References:
  • Preconditions:
    • Authenticated user may be required depending on route.

7. backend/notifications/admin/admins.py

🧷 BIT Summary (per line)

Line BIT Level Trigger Step
89 ⚠️ WARNING 'mark_safe()' is used to mark a string as "safe" for HTML output. This disables escaping and could therefore subject the… Review lines 89-96 in backend/notifications/admin/admins.py

🧩 SAST Analysis Summary

Line Type Level BIT Level CWE(s) Ref
89~96 Cross-Site-Scripting (XSS) ⚠️ WARNING ⚠️ WARNING CWE-79 🔗

🧠 BIT Highlights

  • Line 89: Trigger: 'mark_safe()' is used to mark a string as "safe" for HTML output. This disables escaping and could therefore subject the content to XSS attacks. Use 'django.utils.html.format_html(…; Steps: Review lines 89-96 in backend/notifications/admin/admins.py; Repro: Inspect the indicated code region and verify unsafe data flow or pattern.

📎 Further Context

  • References:
  • Preconditions:
    • Authenticated user may be required depending on route.

8. backend/notifications/rendered_email_template.py

🧷 BIT Summary (per line)

Line BIT Level Trigger Step
58 ⚠️ WARNING 'mark_safe()' is used to mark a string as "safe" for HTML output. This disables escaping and could therefore subject the… Review lines 58-62 in backend/notifications/rendered_email_template.py

🧩 SAST Analysis Summary

Line Type Level BIT Level CWE(s) Ref
58~62 Cross-Site-Scripting (XSS) ⚠️ WARNING ⚠️ WARNING CWE-79 🔗

🧠 BIT Highlights

  • Line 58: Trigger: 'mark_safe()' is used to mark a string as "safe" for HTML output. This disables escaping and could therefore subject the content to XSS attacks. Use 'django.utils.html.format_html(…; Steps: Review lines 58-62 in backend/notifications/rendered_email_template.py; Repro: Inspect the indicated code region and verify unsafe data flow or pattern.

📎 Further Context

  • References:
  • Preconditions:
    • Authenticated user may be required depending on route.

9. backend/participants/admin.py

🧷 BIT Summary (per line)

Line BIT Level Trigger Step
62 ⚠️ WARNING 'mark_safe()' is used to mark a string as "safe" for HTML output. This disables escaping and could therefore subject the… Review lines 62-68 in backend/participants/admin.py
68 ⚠️ WARNING 'mark_safe()' is used to mark a string as "safe" for HTML output Review line 68 in backend/participants/admin.py

🧩 SAST Analysis Summary

Line Type Level BIT Level CWE(s) Ref
62 Cross-Site-Scripting (XSS) ⚠️ WARNING ⚠️ WARNING CWE-79 🔗
68 Cross-Site-Scripting (XSS) ⚠️ WARNING CWE-79 🔗

🧠 BIT Highlights

  • Line 62: Trigger: 'mark_safe()' is used to mark a string as "safe" for HTML output. This disables escaping and could therefore subject the content to XSS attacks. Use 'django.utils.html.format_html(…; Steps: Review lines 62-68 in backend/participants/admin.py; Repro: Inspect the indicated code region and verify unsafe data flow or pattern.

📎 Further Context

  • References:
  • Preconditions:
    • Authenticated user may be required depending on route.

10. backend/reviews/admin.py

🧷 BIT Summary (per line)

Line BIT Level Trigger Step
82 ⚠️ WARNING 'mark_safe()' is used to mark a string as "safe" for HTML output. This disables escaping and could therefore subject the… Review lines 82-192 in backend/reviews/admin.py
170 ⚠️ WARNING 'mark_safe()' is used to mark a string as "safe" for HTML output Review lines 170-176 in backend/reviews/admin.py
186 ⚠️ WARNING 'mark_safe()' is used to mark a string as "safe" for HTML output Review lines 186-192 in backend/reviews/admin.py

🧩 SAST Analysis Summary

Line Type Level BIT Level CWE(s) Ref
82 Cross-Site-Scripting (XSS) ⚠️ WARNING ⚠️ WARNING CWE-79 🔗
170~176 Cross-Site-Scripting (XSS) ⚠️ WARNING CWE-79 🔗
186~192 Cross-Site-Scripting (XSS) ⚠️ WARNING CWE-79 🔗

🧠 BIT Highlights

  • Line 82: Trigger: 'mark_safe()' is used to mark a string as "safe" for HTML output. This disables escaping and could therefore subject the content to XSS attacks. Use 'django.utils.html.format_html(…; Steps: Review lines 82-192 in backend/reviews/admin.py; Repro: Inspect the indicated code region and verify unsafe data flow or pattern.

📎 Further Context

  • References:
  • Preconditions:
    • Authenticated user may be required depending on route.

11. backend/schedule/admin.py

🧷 BIT Summary (per line)

Line BIT Level Trigger Step
646 ⚠️ WARNING 'mark_safe()' is used to mark a string as "safe" for HTML output. This disables escaping and could therefore subject the… Review lines 646-652 in backend/schedule/admin.py
650 ⚠️ WARNING 'mark_safe()' is used to mark a string as "safe" for HTML output Review lines 650-652 in backend/schedule/admin.py

🧩 SAST Analysis Summary

Line Type Level BIT Level CWE(s) Ref
646 Cross-Site-Scripting (XSS) ⚠️ WARNING ⚠️ WARNING CWE-79 🔗
650~652 Cross-Site-Scripting (XSS) ⚠️ WARNING CWE-79 🔗

🧠 BIT Highlights

  • Line 646: Trigger: 'mark_safe()' is used to mark a string as "safe" for HTML output. This disables escaping and could therefore subject the content to XSS attacks. Use 'django.utils.html.format_html(…; Steps: Review lines 646-652 in backend/schedule/admin.py; Repro: Inspect the indicated code region and verify unsafe data flow or pattern.

📎 Further Context

  • References:
  • Preconditions:
    • Authenticated user may be required depending on route.

12. backend/users/managers.py

🧷 BIT Summary (per line)

Line BIT Level Trigger Step
17 ⚠️ WARNING The password on 'user' is being set without validating the password. Call django.contrib.auth.password_validation.valida… Review line 17 in backend/users/managers.py

🧩 SAST Analysis Summary

Line Type Level BIT Level CWE(s) Ref
17 Improper Authentication ⚠️ WARNING ⚠️ WARNING CWE-521 🔗

🧠 BIT Highlights

  • Line 17: Trigger: The password on 'user' is being set without validating the password. Call django.contrib.auth.password_validation.validate_password() with validation functions before setting the p…; Steps: Review line 17 in backend/users/managers.py; Repro: Inspect the indicated code region and verify unsafe data flow or pattern.

📎 Further Context

  • References:
  • Preconditions:
    • Authenticated user may be required depending on route.

13. backend/video_uploads/admin.py

🧷 BIT Summary (per line)

Line BIT Level Trigger Step
104 ⚠️ WARNING 'mark_safe()' is used to mark a string as "safe" for HTML output. This disables escaping and could therefore subject the… Review line 104 in backend/video_uploads/admin.py

🧩 SAST Analysis Summary

Line Type Level BIT Level CWE(s) Ref
104 Cross-Site-Scripting (XSS) ⚠️ WARNING ⚠️ WARNING CWE-79 🔗

🧠 BIT Highlights

  • Line 104: Trigger: 'mark_safe()' is used to mark a string as "safe" for HTML output. This disables escaping and could therefore subject the content to XSS attacks. Use 'django.utils.html.format_html(…; Steps: Review line 104 in backend/video_uploads/admin.py; Repro: Inspect the indicated code region and verify unsafe data flow or pattern.

📎 Further Context

  • References:
  • Preconditions:
    • Authenticated user may be required depending on route.

14. backend/visa/admin.py

🧷 BIT Summary (per line)

Line BIT Level Trigger Step
168 ⚠️ WARNING 'mark_safe()' is used to mark a string as "safe" for HTML output. This disables escaping and could therefore subject the… Review line 168 in backend/visa/admin.py

🧩 SAST Analysis Summary

Line Type Level BIT Level CWE(s) Ref
168 Cross-Site-Scripting (XSS) ⚠️ WARNING ⚠️ WARNING CWE-79 🔗

🧠 BIT Highlights

  • Line 168: Trigger: 'mark_safe()' is used to mark a string as "safe" for HTML output. This disables escaping and could therefore subject the content to XSS attacks. Use 'django.utils.html.format_html(…; Steps: Review line 168 in backend/visa/admin.py; Repro: Inspect the indicated code region and verify unsafe data flow or pattern.

📎 Further Context

  • References:
  • Preconditions:
    • Authenticated user may be required depending on route.

15. backend/visa/templatetags/invitation_letter_asset.py

🧷 BIT Summary (per line)

Line BIT Level Trigger Step
27 ⚠️ WARNING 'mark_safe()' is used to mark a string as "safe" for HTML output. This disables escaping and could therefore subject the… Review lines 27-29 in backend/visa/templatetags/invitation_letter_asset.py

🧩 SAST Analysis Summary

Line Type Level BIT Level CWE(s) Ref
27~29 Cross-Site-Scripting (XSS) ⚠️ WARNING ⚠️ WARNING CWE-79 🔗

🧠 BIT Highlights

  • Line 27: Trigger: 'mark_safe()' is used to mark a string as "safe" for HTML output. This disables escaping and could therefore subject the content to XSS attacks. Use 'django.utils.html.format_html(…; Steps: Review lines 27-29 in backend/visa/templatetags/invitation_letter_asset.py; Repro: Inspect the indicated code region and verify unsafe data flow or pattern.

📎 Further Context

  • References:
  • Preconditions:
    • Authenticated user may be required depending on route.

🛠 Fix Summary

All identified vulnerabilities have been remediated following security best practices such as parameterized queries and proper input validation. Please refer to the diff tab for detailed code changes.

If you have questions or feedback regarding this automated patch, feel free to reach out via AutoFiC GitHub.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant