Skip to content

Security: Arbitrary Python Code Execution via python_formula#1402

Open
tomaioo wants to merge 1 commit into
ingadhoc:19.0from
tomaioo:fix/security/arbitrary-python-code-execution-via-pyth
Open

Security: Arbitrary Python Code Execution via python_formula#1402
tomaioo wants to merge 1 commit into
ingadhoc:19.0from
tomaioo:fix/security/arbitrary-python-code-execution-via-pyth

Conversation

@tomaioo
Copy link
Copy Markdown

@tomaioo tomaioo commented May 6, 2026

Summary

Security: Arbitrary Python Code Execution via python_formula

Problem

Severity: Critical | File: l10n_ar_tax_python/models/account_fiscal_position_l10n_ar_tax.py:L47

The code in account_fiscal_position_l10n_ar_tax.py uses safe_eval to execute arbitrary Python code from the python_formula field. This allows any user with access to configure fiscal positions to execute arbitrary Python code on the server, leading to full system compromise.

Solution

Replace safe_eval with a restricted expression evaluator or remove this feature entirely. If Python formulas are required, implement a sandboxed environment with limited built-in functions and no access to file system, network, or Odoo internals.

Changes

  • l10n_ar_tax_python/models/account_fiscal_position_l10n_ar_tax.py (modified)

The code in account_fiscal_position_l10n_ar_tax.py uses safe_eval to execute arbitrary Python code from the python_formula field. This allows any user with access to configure fiscal positions to execute arbitrary Python code on the server, leading to full system compromise.

Signed-off-by: tomaioo <203048277+tomaioo@users.noreply.github.com>
@roboadhoc
Copy link
Copy Markdown
Contributor

Pull request status dashboard

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.

2 participants