AWS Lambda

AWS Lambda rules for Python

14
Security Rules

Run All AWS Lambda Rules

pathfinder scan --ruleset python/aws_lambda --project .

Rules

Lambda Command Injection via os.system()

CRITICAL

Lambda event data flows to os.system(), enabling arbitrary OS command execution inside the Lambda execution environment.

pythonawslambdacommand-injectionos-systemshelltaint-analysisinter-proceduralCWE-78OWASP-A03
CWE-78
Updated 2026-03-22

Lambda Command Injection via subprocess

CRITICAL

Lambda event data flows to subprocess with shell=True or as a string command, enabling OS command injection in the Lambda execution environment.

pythonawslambdacommand-injectionsubprocessshelltaint-analysisinter-proceduralCWE-78OWASP-A03
CWE-78
Updated 2026-03-22

Lambda Command Injection via os.spawn*()

CRITICAL

Lambda event data flows to os.spawn*() functions, enabling process execution with attacker-controlled arguments in the Lambda execution environment.

pythonawslambdacommand-injectionos-spawntaint-analysisinter-proceduralCWE-78OWASP-A03
CWE-78
Updated 2026-03-22

Lambda Command Injection via asyncio.create_subprocess_shell()

CRITICAL

Lambda event data flows to asyncio.create_subprocess_shell(), enabling OS command injection in async Lambda handlers.

pythonawslambdacommand-injectionasynciocreate-subprocess-shelltaint-analysisinter-proceduralCWE-78OWASP-A03
CWE-78
Updated 2026-03-22

Lambda Command Injection via asyncio.create_subprocess_exec()

CRITICAL

Lambda event data flows to asyncio.create_subprocess_exec(), enabling argument injection in async Lambda handlers.

pythonawslambdacommand-injectionasynciocreate-subprocess-execargument-injectiontaint-analysisinter-proceduralCWE-78OWASP-A03
CWE-78
Updated 2026-03-22

Lambda SQL Injection via psycopg2 cursor.execute()

CRITICAL

Lambda event data flows to psycopg2 cursor.execute() without parameterization, enabling SQL injection against RDS PostgreSQL or Aurora PostgreSQL backends.

pythonawslambdasql-injectionpsycopg2postgresqlrdsaurorataint-analysisinter-proceduralCWE-89OWASP-A03
CWE-89
Updated 2026-03-22

Lambda SQL Injection via pymssql cursor.execute()

CRITICAL

Lambda event data flows to pymssql cursor.execute() without parameterization, enabling SQL injection against RDS SQL Server backends.

pythonawslambdasql-injectionpymssqlsql-serverrdstaint-analysisinter-proceduralCWE-89OWASP-A03
CWE-89
Updated 2026-03-22

Lambda SQL Injection via PyMySQL cursor.execute()

CRITICAL

Lambda event data flows to PyMySQL cursor.execute() without parameterization, enabling SQL injection against RDS MySQL or Aurora MySQL backends via the pure-Python driver.

pythonawslambdasql-injectionpymysqlmysqlrdsaurorataint-analysisinter-proceduralCWE-89OWASP-A03
CWE-89
Updated 2026-03-22

Lambda SQL Injection via SQLAlchemy execute()

CRITICAL

Lambda event data flows to SQLAlchemy session.execute() or connection.execute() without bound parameters, enabling SQL injection against any RDS backend.

pythonawslambdasql-injectionsqlalchemyrdstaint-analysisinter-proceduralCWE-89OWASP-A03
CWE-89
Updated 2026-03-22

Lambda Tainted SQL String Construction

HIGH

Lambda event data is used in SQL string construction via f-strings or concatenation before being passed to a database execute call, enabling SQL injection.

pythonawslambdasql-injectionstring-constructionf-stringconcatenationtaint-analysisinter-proceduralCWE-89OWASP-A03
CWE-89
Updated 2026-03-22

Lambda DynamoDB FilterExpression Injection

HIGH

Lambda event data flows to a DynamoDB FilterExpression string, enabling expression manipulation in serverless DynamoDB scan and query operations.

pythonawslambdadynamodbnosql-injectionfilter-expressionserverlesstaint-analysisinter-proceduralCWE-943OWASP-A03
CWE-943
Updated 2026-03-22

Lambda XSS via Tainted HTML Response Body

HIGH

Lambda event data is embedded directly in an HTML response body returned to API Gateway, enabling Cross-Site Scripting attacks against end users.

pythonawslambdaxsshtml-responseapi-gatewaytaint-analysisinter-proceduralCWE-79OWASP-A03
CWE-79
Updated 2026-03-22

Lambda Code Injection via eval() or exec()

CRITICAL

Lambda event data flows to eval() or exec(), enabling arbitrary Python code execution with the full permissions of the Lambda execution environment.

pythonawslambdacode-injectionevalexecrcetaint-analysisinter-proceduralCWE-95OWASP-A03
CWE-95
Updated 2026-03-22

Lambda Remote Code Execution via Pickle Deserialization

CRITICAL

Lambda event data flows to pickle.loads() or pickle.load(), enabling arbitrary Python code execution during deserialization of attacker-controlled bytes.

pythonawslambdadeserializationpicklercetaint-analysisinter-proceduralCWE-502OWASP-A08
CWE-502
Updated 2026-03-22