VAITP Dataset

← Back to the dataset

CVE-2026-96795

Arbitrary OS command execution via unsafe exec() in HorillaListView.export_data.

  • CVSS 8.8
  • CWE-94
  • Input Validation and Sanitization
  • Remote

Horilla is an HR and CRM software. Prior to 2.0.0, HorillaListView.export_data in horilla_views/generic/cbv/views.py accepts an authenticated user's columns POST parameter, takes field_tuple[1], interpolates it into dynamic_fn_str as Python source, and passes the generated function definition to exec(). A crafted string that remains valid under ast.literal_eval can inject Python syntax into a default argument evaluated during function definition, allowing arbitrary operating-system commands to execute with the application process privileges, including root privileges in the shipped Docker image. This issue is fixed in version 2.0.0.

CVSS base score
8.8
Published
2026-09-25
OWASP
A03 Injection
Orthogonal defect classification
Function
Code defect classification
Incorrect Functionality
Category
Input Validation and Sanitization
Subcategory
Command Injection
Accessibility scope
Remote
Impact
Arbitrary Code Execution
Affected component
Horilla

Solution

Upgrade Horilla to version 2.0.0 or later.

Vulnerable code sample

import ast
from django.views import View
from django.http import HttpResponse

class HorillaListView(View):
    def export_data(self, request):
        # VULNERABLE: exec of user-controlled default argument
        columns = request.POST.get('columns', '[]')
        # columns is expected to be a list of (field_name, field_tuple) strings
        field_tuples = ast.literal_eval(columns)
        dynamic_fn_str = """
def generate_row(item, extra={default}):
    return [getattr(item, f) for f in extra]
""".format(default=field_tuples[1][1])
        exec(dynamic_fn_str, globals())
        generate = globals()['generate_row']
        # placeholder for actual export logic
        return HttpResponse("Exported")

Patched code sample

import ast
from django.views import View
from django.http import HttpResponse

class HorillaListView(View):
    def export_data(self, request):
        # FIX: avoid exec, use safe evaluation of column list
        columns = request.POST.get('columns', '[]')
        field_tuples = ast.literal_eval(columns)
        # Build the list of fields without code generation
        extra_fields = [field_tuples[i][1] for i in range(len(field_tuples))]
        def generate_row(item, extra=extra_fields):
            return [getattr(item, f) for f in extra]
        # placeholder for actual export logic
        return HttpResponse("Exported")

Cite this entry

@misc{vaitp:cve202696795,
  title        = {{Arbitrary OS command execution via unsafe exec() in HorillaListView.export_data.}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2026},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2026-96795},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-96795/}}
}

Download this entry as JSON Download the whole dataset

Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.

The supreme art of war is to subdue the enemy without fighting.

Sun Tzu – “The Art of War”

:: Shaping the future through research and ingenuity ::

Before you use the VAITP AI models

Please read and accept the following disclaimer:

By choosing "I understand and accept", you acknowledge that you understand and agree to these terms.