n8n-code-python

Warn

Audited by Runlayer on Feb 21, 2026

Risk Level: MEDIUM
Scan Summary
Max Score
78%
Files
6
Flagged
6
Chunks
15
Flagged Files (6)
COMMON_PATTERNS.mdHIGH
78.3%

Malicious tool definition detected

Tool: COMMON_PATTERNS.md [1/3] Description: # Common Patterns - Python Code Node Production-tested Python patterns for n8n Code nodes.

Tool: COMMON_PATTERNS.md [2/3] Description: Create normalized contact normalized_contacts.append({ "json": { "id": raw_contact.get("id", ""), "first_name": first_name.strip(), "last_name": last_name.strip(), "full_name": f"{first_name} {last_name}".strip(), "email": email, "phone": phone, "status": status, "source": source, "normalized_at": datetime.now().isoformat(), "original_data": raw_contact } }) return normalized_contacts ``` ### Key Techniques - Multiple field name variations handling - S

Tool: COMMON_PATTERNS.md [3/3]

DATA_ACCESS.mdHIGH
78.3%

Malicious tool definition detected

Tool: DATA_ACCESS.md [1/2] Description: # Data Access Patterns - Python Code Node Complete guide to accessing data in n8n Code nodes using Python.

Tool: DATA_ACCESS.md [2/2] Description: "processed_at": datetime.now().isoformat() } }] ``` ### Example 2: Compare Across Nodes ```python old_data = _node["Get Old Data"]["json"] new_data = _node["Get New Data"]["json"] # Simple comparison changes = { "added": [n for n in new_data if n.get("id") not in [o.get("id") for o in old_data]], "removed": [o for o in old_data if o.get("id") not in [n.get("id") for n in new_data]] } return [{ "json": { "changes": changes, "summary": { "added": len(changes

ERROR_PATTERNS.mdHIGH
78.3%

Malicious tool definition detected

Tool: ERROR_PATTERNS.md [1/2] Description: # Error Patterns - Python Code Node Common Python Code node errors and how to fix them.

Tool: ERROR_PATTERNS.md [2/2] Description: "json": { "error": f"Expected 2+ items, got {len(all_items)}" } }] ``` ### Safe First Item Access ```python # ✅ CORRECT: Use _input.first() instead of [0] # This is safer than manual indexing first_item = _input.first()["json"] return [{"json": first_item}] # ✅ ALSO CORRECT: Check before accessing all_items = _input.all() if all_items: first_item = all_items[0]["json"] else: first_item = {} return [{"json": first_item}] ``` ### Slice Instead of Index ``

README.mdHIGH
78.3%

Malicious tool definition detected

Tool: README.md [1/2] Description: # n8n Code Python Skill Expert guidance for writing Python code in n8n Code nodes. --- ## ⚠️ Important: JavaScript First **Use JavaScript for 95% of use cases.** Python in n8n has **NO external libraries** (no requests, pandas, numpy).

Tool: README.md [2/2] Description: No Data Analysis Library **Problem**: No `pandas` or `numpy` **Workaround**: Use list comprehensions and standard library ### Limitation 3: No Database Drivers **Problem**: No `psycopg2`, `pymongo`, etc.

SKILL.mdHIGH
78.3%

Malicious tool definition detected

Tool: SKILL.md [1/3] Description: --- name: n8n-code-python description: Write Python code in n8n Code nodes.

Tool: SKILL.md [2/3] Description: NOT Available ```python # ❌ NOT AVAILABLE - Will raise ModuleNotFoundError import requests # ❌ No import pandas # ❌ No import numpy # ❌ No import scipy # ❌ No from bs4 import BeautifulSoup # ❌ No import lxml # ❌ No ``` ### What IS Available (Standard Library) ```python # ✅ AVAILABLE - Standard library only import json # ✅ JSON parsing import datetime # ✅ Date/time operations import re # ✅ Regular expressions import base64 # ✅ Base64 encoding/decoding import hash

Tool: SKILL.md [3/3]

STANDARD_LIBRARY.mdHIGH
78.3%

Malicious tool definition detected

Tool: STANDARD_LIBRARY.md [1/3] Description: # Standard Library Reference - Python Code Node Complete guide to available Python standard library modules in n8n Code nodes. --- ## ⚠️ Critical Limitation **NO EXTERNAL LIBRARIES AVAILABLE** Python Code nodes in n8n have **ONLY** the Python standard library.

Tool: STANDARD_LIBRARY.md [2/3] Description: "Hello, World!" # Generate MD5 hash md5_hash = hashlib.md5(text.encode('utf-8')).hexdigest() return [{ "json": { "original": text, "md5": md5_hash } }] ``` ### SHA256 Hash ```python import hashlib data = _input.first()["json"]["body"] text = data.get("password", "") # Generate SHA256 hash (more secure than MD5) sha256_hash = hashlib.sha256(text.encode('utf-8')).hexdigest() return [{ "json": { "hashed": sha256_hash } }] ``` ### Generate Unique ID ```py

Tool: STANDARD_LIBRARY.md [3/3] Description: operations requiring external libraries, # use n8n nodes instead: # - HTTP Request for API calls # - Postgres/MySQL for databases # - Extract from File for parsing # Then process results in Code node result = _input.first()["json"] return [{"json": {"processed": result}}] ``` ### 3.

Audit Metadata
Max File Score
78%
Classification
UNKNOWN_SERVER
Files Scanned
6
Files Flagged
6
Chunks Analyzed
15
Analyzed
Feb 21, 2026, 11:58 PM
Security Audit — runlayer — n8n-code-python