Scan Overview

24
Total Issues
Files Scanned: 17
Target: vulnerability-scan@3

Severity Distribution

0
Blocker
2
Critical
15
High
2
Medium
5
Low
0
Info

Detailed Findings

Critical CWE-798

Hardcoded Credentials in Configuration

vulnerability-scan@3/src/api/vip_labelling_api.py

The application uses hardcoded credentials for MongoDB and Label Studio in the `.env` file. An attacker can easily extract these credentials from the environment or configuration files, leading to unauthorized access.

Impact:
An attacker could gain full control over the database and potentially use this access to exfiltrate sensitive data or execute further attacks on other components of the system.
Mitigation:
Use secure methods for storing and retrieving credentials. Consider using environment variables, secrets management services like AWS Secrets Manager, or HashiCorp Vault.
Line:
N/A
OWASP Category:
A02:2021 - Cryptographic Failures
NIST 800-53:
AC-2, AC-3
CVSS Score:
9.8
Related CVE:
Pattern-based finding
Priority:
Immediate
Critical CWE-287

Missing Authentication for Sensitive Operations

vulnerability-scan@3/src/middleware/__init__.py

The application does not enforce authentication for certain sensitive operations, such as those involving configuration settings or access control. An attacker can manipulate these settings remotely without proper authorization.

Impact:
An attacker can change critical configurations, potentially leading to a complete system compromise if the manipulated setting has severe consequences (e.g., disabling security features).
Mitigation:
Enforce authentication for all sensitive operations. Use role-based access control or other mechanisms to ensure that only authorized users can modify these settings.
Line:
N/A
OWASP Category:
A07:2021-Authentication Failures
NIST 800-53:
AC-2
CVSS Score:
9.1
Related CVE:
None
Priority:
Immediate
High CWE-798

Potential Hardcoded Credentials

vulnerability-scan@3/src/__init__.py

The codebase contains a potential hardcoded credential in the form of an API key. This is stored directly within the source code without any protection mechanisms, making it susceptible to exploitation by anyone with access to this file.

Impact:
An attacker could use the hardcoded credentials to gain unauthorized access to the system's APIs or internal services, potentially leading to full system compromise if they can exploit other vulnerabilities.
Mitigation:
Implement a secure method for storing and retrieving API keys such as using environment variables or securely encrypted configuration files. Avoid exposing sensitive information in source code.
Line:
N/A (Pattern-based finding)
OWASP Category:
A07:2021 - Authentication Failures
NIST 800-53:
IA-2 - Identification and Authentication
CVSS Score:
7.5
Related CVE:
Pattern-based finding
Priority:
Immediate
High CWE-20

Insecure Configuration of Pydantic Model

vulnerability-scan@3/src/mapperclasses/video_annotate_models.py

The code does not properly restrict the keys that can be passed to the Pydantic model `WorkflowRequest`. An attacker can pass arbitrary keys in the request, which will be mapped according to the `CAMEL_TO_SNAKE_MAPPING` dictionary. This includes sensitive fields like 'epochs', 'use_weights', and others if not properly validated.

Impact:
An attacker could manipulate these mappings to inject arbitrary data into the system, potentially leading to unauthorized access or data leakage depending on the context of how this model is used in the application. For example, an attacker might be able to set privileged parameters that bypass intended access controls.
Mitigation:
Implement strict key validation within the `handle_input_key_mapping` method to only accept keys explicitly defined in `ALLOWED_KEYS`. Additionally, consider using Pydantic's built-in features for handling extra fields more securely if not already configured to ignore unknown keys.
Line:
45-52
OWASP Category:
A05:2021 - Security Misconfiguration
NIST 800-53:
AC-6 - Least Privilege, IA-5 - Authenticator Management
CVSS Score:
7.5
Related CVE:
Pattern-based finding
Priority:
Immediate
High CWE-20

Unvalidated Input in Workflow Request

vulnerability-scan@3/src/api/video_annotate_api.py

The endpoint accepts a JSON payload via POST request, which includes user-controlled input in the 'req_data' field. If this input is not properly validated or sanitized before being processed by convert_to_yolo_and_create_zip, it could lead to command injection or other types of injection attacks.

Impact:
An attacker can exploit this vulnerability to execute arbitrary code on the server, potentially leading to complete system compromise. The specific impact depends on what exactly is executed and where in the file system that execution takes place.
Mitigation:
Ensure all user-controlled input is properly validated and sanitized before being processed by convert_to_yolo_and_create_zip. Consider using a library or built-in function to safely parse JSON data, such as Python's json module with strict=True parameter set.
Line:
29-41
OWASP Category:
A03:2021-Injection
NIST 800-53:
SI-10: Information Input Validation
CVSS Score:
7.5
Related CVE:
Pattern-based finding
Priority:
Immediate
High CWE-287

Missing Authentication for Sensitive Endpoint

vulnerability-scan@3/src/api/video_annotate_api.py

The '/submit-workflow/' endpoint does not enforce any authentication mechanism, making it accessible to unauthenticated users. This could allow an attacker to submit arbitrary workflow requests that the application processes in a way that is detrimental to its security or functionality.

Impact:
An attacker can bypass all access controls and perform actions within the scope of the user role they have been assigned (if any). If there are no restrictions on who can submit workflows, this could lead to unauthorized data processing or other malicious activities.
Mitigation:
Implement proper authentication mechanisms such as OAuth 2.0 with JWT tokens, API keys, or more sophisticated session management techniques. Ensure that only authenticated users have access to sensitive endpoints.
Line:
45-61
OWASP Category:
A07:2021-Authentication Failures
NIST 800-53:
AC-2: Account Management
CVSS Score:
9.8
Related CVE:
Priority:
Immediate
High CWE-305

Missing API Key Authentication

vulnerability-scan@3/src/api/__init__.py

The code does not enforce authentication via an API key for accessing the API endpoints. Without proper authentication, any unauthenticated user can make requests to these endpoints, potentially leading to unauthorized data access or system manipulation.

Impact:
An attacker could exploit this by making automated requests to the API endpoints without restrictions, potentially gaining unauthorized access to sensitive information or performing actions within the application that require administrative privileges.
Mitigation:
Enforce authentication at the router level using Depends(get_api_key) in main.py. Ensure that all routes are protected and only accessible with a valid API key. Consider implementing stronger authentication mechanisms such as OAuth, JWT, or other token-based authentication if applicable.
Line:
OWASP Category:
A07:2021-Authentication Failures
NIST 800-53:
AC-2, AC-3
CVSS Score:
7.5
Related CVE:
Priority:
Short-term
High CWE-287

Missing Credential Validation

vulnerability-scan@3/src/api/vip_labelling_api.py

The application does not validate credentials when creating a new VideoLabeling instance in the `start-stop-data-collection` endpoint. An attacker can bypass this validation by sending a crafted request, leading to potential unauthorized access or data leakage.

Impact:
An attacker could gain unauthorized access to sensitive configurations and potentially exploit other vulnerabilities if they have valid credentials for Label Studio.
Mitigation:
Ensure that all endpoints requiring authentication validate the provided credentials. Consider implementing stronger authentication mechanisms such as OAuth or JWT tokens.
Line:
62-69
OWASP Category:
A07:2021 - Authentication Failures
NIST 800-53:
AC-2, AC-3
CVSS Score:
7.5
Related CVE:
Pattern-based finding
Priority:
Immediate
High CWE-250

Insecure Configuration of API Keys

vulnerability-scan@3/src/config/settings.py

The application uses a hardcoded default API key, which is insecure. An attacker can easily use this key to bypass authentication mechanisms and gain unauthorized access to the system.

Impact:
An attacker with the hardcoded API key can perform any action within the scope of the compromised account, potentially leading to data leakage or complete system compromise.
Mitigation:
Remove or regenerate the default API key. Use environment variables or a secure configuration management tool to manage sensitive keys securely at runtime.
Line:
45
OWASP Category:
A07:2021 - Authentication Failures
NIST 800-53:
AC-2, AC-3, IA-2
CVSS Score:
7.5
Related CVE:
Pattern-based finding
Priority:
Immediate
High CWE-287

Missing Authentication for Sensitive Operations

vulnerability-scan@3/src/config/constants.py

The application uses environment variables to configure sensitive operations such as accessing cloud storage (S3) without any form of authentication. An attacker can manipulate these environment variables to gain unauthorized access to the system, potentially leading to data leakage or complete system compromise.

Impact:
An attacker could exploit this by manipulating environment variables to bypass authentication and access restricted areas of the application, potentially leading to sensitive information disclosure or full system takeover.
Mitigation:
Implement proper authentication mechanisms for accessing S3 storage. Use AWS SDKs with appropriate IAM roles and policies that restrict access based on user permissions. Avoid hardcoding credentials in the application code; instead, use secure methods like environment variables securely managed through a vault service.
Line:
N/A
OWASP Category:
A07:2021 - Authentication Failures
NIST 800-53:
AC-2, AC-3, IA-2
CVSS Score:
7.5
Related CVE:
Pattern-based finding
Priority:
Short-term
High CWE-306

Insecure Configuration of Rate Limiting

vulnerability-scan@3/src/middleware/__init__.py

The rate limiting middleware allows configuration with user-controlled parameters `max_requests` and `window_seconds`. An attacker can set these values to extreme values, such as a very large number of requests or an extremely short time window. This could lead to denial of service (DoS) attacks against the server by exhausting its processing capacity.

Impact:
An attacker can configure the rate limiter to allow an excessive number of requests within a very short period, overwhelming the server and causing it to become unavailable to legitimate users.
Mitigation:
Ensure that parameters for rate limiting are validated to prevent extreme values. Consider implementing more robust rate limiting mechanisms or alerting on suspicious configurations.
Line:
41, 42
OWASP Category:
A05:2021-Security Misconfiguration
NIST 800-53:
CA-2
CVSS Score:
7.5
Related CVE:
Pattern-based finding
Priority:
Short-term
High CWE-319

Insecure Configuration of HTTPS Enforcement

vulnerability-scan@3/src/middleware/__init__.py

The application is configured to enforce HTTPS, but the configuration does not include validation or sanitization of SSL/TLS certificates. This leaves the system vulnerable to man-in-the-middle attacks and other certificate-based vulnerabilities.

Impact:
An attacker can intercept communications between the server and clients by exploiting insecure SSL/TLS configurations, leading to potential data leakage and unauthorized access.
Mitigation:
Implement strict validation of SSL/TLS certificates. Consider using more secure protocols or mechanisms that enforce certificate verification.
Line:
N/A
OWASP Category:
A05:2021-Security Misconfiguration
NIST 800-53:
SC-13
CVSS Score:
7.5
Related CVE:
None
Priority:
Immediate
High CWE-284

Insecure S3 Bucket Configuration

vulnerability-scan@3/src/core/vip_labelling_service.py

The code allows for the configuration of an S3 bucket without proper authentication or authorization checks. An attacker can specify any AWS region, access key ID, and secret access key when configuring the S3 bucket, leading to potential unauthorized access and data leakage.

Impact:
An attacker could gain unauthorized access to the S3 bucket by using the specified AWS credentials, potentially leading to data breach or system takeover.
Mitigation:
Implement proper authentication mechanisms before allowing configuration of an S3 bucket. Use AWS IAM roles and policies to restrict access based on user permissions. Additionally, consider encrypting sensitive information at rest in the S3 bucket.
Line:
N/A
OWASP Category:
A01:2021 - Broken Access Control
NIST 800-53:
AC-2, AC-3
CVSS Score:
7.5
Related CVE:
Pattern-based finding
Priority:
Immediate
High CWE-287

Improper Authentication in S3 Configuration

vulnerability-scan@3/src/core/vip_labelling_service.py

The code does not properly authenticate the user before allowing configuration of an S3 bucket. This allows any authenticated user to configure arbitrary S3 buckets, including specifying sensitive AWS credentials.

Impact:
An attacker can gain unauthorized access to the configured S3 bucket by using the provided AWS credentials, leading to potential data breach or system compromise.
Mitigation:
Implement proper authentication mechanisms before allowing configuration of an S3 bucket. Use AWS IAM roles and policies to restrict access based on user permissions. Additionally, consider encrypting sensitive information at rest in the S3 bucket.
Line:
N/A
OWASP Category:
A07:2021 - Authentication Failures
NIST 800-53:
AC-2, AC-3
CVSS Score:
7.5
Related CVE:
Pattern-based finding
Priority:
Immediate
High CWE-20

Unvalidated Input for File Upload

vulnerability-scan@3/src/core/video_annotate_service.py

The code allows users to upload files, but it does not perform any validation or sanitization on the file content before saving it. An attacker can upload a malicious file that could execute arbitrary code or overwrite important system files.

Impact:
An attacker can gain remote code execution by uploading a specially crafted file. The impact is complete system compromise with trivial exploitation.
Mitigation:
Implement input validation and sanitization to ensure only expected file types are accepted. Use libraries like `filetype` or `mimetypes` to validate the MIME type of uploaded files before saving them.
Line:
45-52
OWASP Category:
A03:2021 - Injection
NIST 800-53:
AC-6 - Least Privilege, IA-2 - Identification and Authentication
CVSS Score:
9.8
Related CVE:
Pattern-based finding
Priority:
Immediate
High CWE-502

Insecure Deserialization

vulnerability-scan@3/src/core/vip_labelling_cronjob.py

The code deserializes untrusted input from a configuration file, which can lead to remote code execution (RCE) if the attacker can manipulate the serialized data format. For example, an attacker could exploit this by crafting a malicious payload in YAML or JSON format that, when deserialized, executes arbitrary commands on the server.

Impact:
An attacker with sufficient knowledge of the system architecture and access to modify configuration files could execute arbitrary code on the server, potentially gaining full control over the system. This can lead to data breaches, unauthorized access to sensitive information, and complete system compromise.
Mitigation:
Implement input validation to ensure that only expected data formats are accepted. Use secure libraries for deserialization operations, such as ensuring proper authentication mechanisms are in place before allowing deserialization. Consider using safer alternatives like XML parsers with built-in security features if possible.
Line:
N/A
OWASP Category:
A06:2021-Vulnerable Components
NIST 800-53:
SI-2, SI-16
CVSS Score:
9.8
Related CVE:
Pattern-based finding
Priority:
Immediate
High CWE-306

Missing Authentication for Sensitive Operations

vulnerability-scan@3/src/core/vip_labelling_cronjob.py

The application performs sensitive operations without requiring authentication, which can be exploited by an attacker to gain unauthorized access. For instance, the code allows deletion of tasks with annotations directly from a public endpoint without any form of user authentication.

Impact:
An attacker could exploit this vulnerability to delete critical task data, leading to a denial of service (DoS) or potentially compromising further system functionalities depending on the role and permissions of the affected tasks.
Mitigation:
Ensure that all sensitive operations are protected by appropriate authentication mechanisms. Implement proper user authentication for endpoints handling sensitive information. Consider using OAuth 2.0 with PKCE, JWT tokens, or other secure authentication schemes to protect these operations.
Line:
45-52
OWASP Category:
A07:2021-Authentication Failures
NIST 800-53:
AC-6, AC-17
CVSS Score:
9.1
Related CVE:
N/A
Priority:
Immediate
Medium CWE-20

Improper Error Handling in File Download

vulnerability-scan@3/src/core/video_annotate_service.py

The code does not properly handle errors when downloading files, which can lead to information disclosure if an error occurs during the download process.

Impact:
An attacker could potentially gain access to sensitive system files by exploiting this vulnerability and triggering an error condition.
Mitigation:
Implement proper error handling mechanisms that do not disclose detailed error messages. Use logging instead of printing stack traces directly in user-facing interfaces.
Line:
78-85
OWASP Category:
A03:2021 - Injection
NIST 800-53:
AC-6 - Least Privilege, IA-2 - Identification and Authentication
CVSS Score:
4.3
Related CVE:
Priority:
Short-term
Medium CWE-319

Cleartext Transmission of Credentials

vulnerability-scan@3/src/core/vip_labelling_cronjob.py

The application transmits credentials in cleartext over HTTP, which can be intercepted and read by an attacker. For example, the code includes hardcoded credentials for external services such as MongoDB and Label Studio.

Impact:
An attacker with access to the network could intercept and read the transmitted credentials, leading to unauthorized access to sensitive information stored in these external services or further exploitation of other vulnerabilities that require these credentials.
Mitigation:
Use HTTPS instead of HTTP for all communications. Encrypt data at rest by storing passwords securely and using secure cryptographic algorithms. Consider implementing token-based authentication where possible to avoid sending credentials over the network.
Line:
N/A
OWASP Category:
A07:2021-Authentication Failures
NIST 800-53:
AC-2, AC-17
CVSS Score:
4.3
Related CVE:
N/A
Priority:
Short-term
Low CWE-319

[Downgraded] Insecure Default Configuration

vulnerability-scan@3/src/mapperclasses/__init__.py

The module does not enforce any security best practices, such as disabling direct access to potentially sensitive classes or methods. An attacker can easily import and use these modules without authentication or authorization checks.

Impact:
An attacker could bypass intended access controls by importing the vulnerable modules directly into a malicious script or application, leading to unauthorized data exposure or system compromise.
Mitigation:
Ensure that all sensitive classes and methods are protected with appropriate security mechanisms such as authentication and authorization. Consider using Python's module-level guards (e.g., `__all__`) to restrict direct access to the module contents.
Line:
OWASP Category:
A05:2021-Security Misconfiguration
NIST 800-53:
AC-2, AC-6, CM-6
CVSS Score:
7.5
Related CVE:
Pattern-based finding
Priority:
Short-term
Low CWE-319

[Downgraded] Insecure Default Configuration

vulnerability-scan@3/src/mapperclasses/vip_labelling_models.py

The application uses default values for sensitive configurations such as s3_access_key, s3_secret_key, and s3_bucket_name without any validation or sanitization. An attacker can exploit this by sending a crafted request with these parameters set to known malicious values, leading to unauthorized access to S3 buckets.

Impact:
An attacker could gain unauthorized access to the S3 storage associated with the application, potentially compromising sensitive data stored in those buckets.
Mitigation:
Implement input validation and sanitization for all user-controlled inputs. Use environment variables or configuration files securely managed through secure channels such as Vault or Kubernetes secrets.
Line:
21-26
OWASP Category:
A05:2021-Security Misconfiguration
NIST 800-53:
AC-2, AC-3, CM-6
CVSS Score:
7.5
Related CVE:
Pattern-based finding
Priority:
Short-term
Low CWE-200

Wildcard Import

vulnerability-scan@3/src/config/__init__.py

The code imports both 'settings' and 'Settings' from 'src.config.settings'. While this is not inherently insecure, it violates the principle of explicit imports to avoid potential namespace conflicts or hidden dependencies.

Impact:
Potential for unintended side effects if there are future changes in 'src.config.settings' that affect both exports, leading to unpredictable behavior.
Mitigation:
Refactor the import statement to be explicit: from src.config.settings import settings, Settings
Line:
OWASP Category:
A06:2021-Vulnerable Components
NIST 800-53:
AC-6- Least Privilege
CVSS Score:
0.1
Related CVE:
Priority:
Short-term
Low CWE-200

Wildcard Imports

vulnerability-scan@3/src/utils/__init__.py

The code imports all modules from the utils package using a wildcard import, which can lead to dependency confusion attacks where an attacker replaces a legitimate module with a malicious one.

Impact:
An attacker could replace a legitimate module with a malicious version, leading to unpredictable behavior and potential data leakage or system compromise.
Mitigation:
Use explicit imports for each required module. Example: from utils import func1, func2
Line:
OWASP Category:
A06:2021-Vulnerable Components
NIST 800-53:
AC-6, CA-2
CVSS Score:
4.3
Related CVE:
Pattern-based finding
Priority:
Short-term
Low CWE-200

Wildcard Imports

vulnerability-scan@3/src/core/__init__.py

The module imports all symbols from the specified modules using wildcard imports. This practice is discouraged as it can lead to namespace pollution and potential conflicts, but does not pose a direct security risk unless used incorrectly.

Impact:
While not inherently insecure, improper use of wildcard imports can lead to harder-to-debug issues due to unclear variable usage in the importing module.
Mitigation:
Use explicit imports for each symbol. This practice enhances clarity and avoids potential namespace conflicts or accidental overrides of variables.
Line:
OWASP Category:
A06:2021-Vulnerable Components
NIST 800-53:
CA-2, CM-6
CVSS Score:
0.1
Related CVE:
Priority:
Short-term