Improper Control of Generation of Code ('Code Injection') Affecting ethyca-fides package, versions [2.19.0,2.44.0)


Severity

Recommended
0.0
medium
0
10

CVSS assessment made by Snyk's Security Team

    Threat Intelligence

    Exploit Maturity
    Proof of concept
    EPSS
    0.05% (20th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk ID SNYK-PYTHON-ETHYCAFIDES-7897504
  • published 5 Sep 2024
  • disclosed 4 Sep 2024
  • credit grmpyninja

How to fix?

Upgrade ethyca-fides to version 2.44.0 or higher.

Overview

ethyca-fides is an Open-source ecosystem for data privacy as code.

Affected versions of this package are vulnerable to Improper Control of Generation of Code ('Code Injection') due to improper input sanitization and lack of rendering environment restrictions in the Email Templating feature. An attacker can execute arbitrary code on the server by injecting malicious templates.

Note:

This is only exploitable if the attacker has Owner or Contributor role access.

OAuth clients with the messaging-template:update scope are also authorized to use the PUT /api/v1/messaging/templates/ Fides Webserver API endpoint and may also exploit this vulnerability.

PoC

Your privacy request has been denied.
*bb*
{% for s in ().__class__.__base__.__subclasses__() %}{% if "warning" in s.__name__ %}{{s()._module.__builtins__['__import__']('os').popen("env").read() }}{% endif %}
{% endfor %}
*aa*

References

CVSS Scores

version 4.0
version 3.1
Expand this section

Snyk

Recommended
6.4 medium
  • Attack Vector (AV)
    Network
  • Attack Complexity (AC)
    Low
  • Attack Requirements (AT)
    None
  • Privileges Required (PR)
    High
  • User Interaction (UI)
    None
  • Confidentiality (VC)
    None
  • Integrity (VI)
    None
  • Availability (VA)
    None
  • Confidentiality (SC)
    High
  • Integrity (SI)
    High
  • Availability (SA)
    High