How to validate expression input

Hi
i would like to know if there is a way to validate expression input or block it due to security issue. what i found for example that if i am creating a simple workflow with httpRequest to localhost and add a custom header as follows

{{ (Object.entries(process.env).map(([key, value]) => `${key}:${value}`)).join(';') }}

i am get back the all env’s from the backend service included the N8N_ENCRYPTION_KEY

Information on your n8n setup

  • **n8n version:1.31
  • **Database (default: SQLite):postgres
  • **n8n EXECUTIONS_PROCESS setting (default: own, main):main
  • **Running n8n via (Docker, npm, n8n cloud, desktop app):docker
  • Operating system:

hello @mtubul

you can restrict access to ENV variables by setting the ENV
N8N_BLOCK_ENV_ACCESS_IN_NODE = true

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.