Skip to content

Commit 5dabcb8

Browse files
authored
N8N - CRE Detection (#135)
* Add N8N silent data loss detection rule and related log files; enhance categories and tags for workflow automation issues * minor change * minor change
1 parent 08c609d commit 5dabcb8

File tree

4 files changed

+103
-1
lines changed

4 files changed

+103
-1
lines changed
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
rules:
2+
- cre:
3+
id: CRE-2025-0179
4+
severity: 0
5+
title: N8N Workflow Silent Data Loss During Execution
6+
category: workflow-automation-problem
7+
author: Claude Code Assistant
8+
description: |
9+
N8N workflow automation platform experiences critical silent data loss where items
10+
disappear between workflow nodes without generating error messages. This high-severity
11+
issue affects long-running workflows (60-115+ minutes) and can cause workflows to
12+
randomly cancel mid-execution, leading to incomplete processing and data integrity
13+
problems. Items silently vanish between nodes, with different item counts across
14+
the workflow pipeline, making the issue particularly dangerous for production systems
15+
that rely on complete data processing.
16+
cause: |
17+
* Workflow execution engine fails to properly track items between nodes in long-running workflows
18+
* Memory management issues during extended workflow processing causing item references to be lost
19+
* Race conditions in the worker queue system when handling multiple concurrent items
20+
* Node-to-node data transfer mechanisms failing silently under certain load conditions
21+
* Queue worker timeout or resource contention causing partial item processing without error reporting
22+
* Database transaction issues where some items fail to persist between workflow stages
23+
tags:
24+
- n8n
25+
- workflow-automation
26+
- data-loss
27+
- silent-failure
28+
- production-critical
29+
- data-integrity
30+
- public
31+
mitigation: |
32+
- **Implement workflow item counting checks** - Add validation nodes between critical
33+
processing steps to verify item counts match expected values
34+
- **Enable comprehensive execution logging** - Set N8N_LOG_LEVEL to debug and
35+
EXECUTIONS_DATA_SAVE_ON_SUCCESS to 'all' to capture detailed execution data
36+
- **Add workflow timeout monitoring** - Monitor executions that cancel around 21-23
37+
minute mark and implement retry mechanisms for failed workflows
38+
- **Implement data integrity validation** - Add checksum or validation steps at
39+
workflow start/end to detect silent data loss
40+
- **Use error handling workflows** - Configure error workflows to capture and log
41+
execution failures, even when main workflow fails silently
42+
- **Monitor execution metrics** - Set up alerting on workflow completion rates and
43+
item processing inconsistencies
44+
- **Consider workflow segmentation** - Break long workflows into smaller, more
45+
manageable chunks to reduce exposure to the data loss issue
46+
references:
47+
- https://github.com/n8n-io/n8n/issues/14909
48+
- https://docs.n8n.io/flow-logic/error-handling/
49+
- https://community.n8n.io/t/workflow-randomly-cancels-mid-execution-without-error-data-items-silently-dropped-between-nodes/51141
50+
applications:
51+
- name: n8n
52+
version: ">= 1.90.0"
53+
processName: n8n
54+
containerName: n8n
55+
impact: |
56+
Silent data loss in workflow automation can cause critical business processes to fail
57+
without detection, leading to incomplete data processing, missing business transactions,
58+
failed integrations, and potential compliance violations. The silent nature makes it
59+
extremely difficult to detect and troubleshoot, potentially causing weeks or months
60+
of data integrity issues before discovery.
61+
impactScore: 9
62+
mitigationScore: 7
63+
metadata:
64+
kind: prequel
65+
id: N8nSilentDataLossDetection919
66+
gen: 1
67+
rule:
68+
sequence:
69+
window: 120s
70+
event:
71+
source: cre.log.n8n
72+
order:
73+
- regex: "(cancelled mid-execution|execution terminated unexpectedly|workflow.*cancelled|Execution.*cancelled)"
74+
- regex: "(silent data loss detected|data.*loss|itemsLost|dataIntegrityIssue.*true|Items processed inconsistently|Data integrity check failed|Expected [0-9]+ items, found [0-9]+ items)"

rules/cre-2025-0179/test.log

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Aug 27 18:30:29 n8n[1234]: INFO: Starting workflow execution exec_384574 for workflow workflow_9084
2+
Aug 27 18:35:29 n8n[1234]: DEBUG: Node processing started - HTTP Request node
3+
Aug 27 18:45:29 n8n[1234]: INFO: Processing 150 items through workflow pipeline
4+
Aug 27 18:53:29 n8n[1234]: DEBUG: Node completed with 142 items (expected 150)
5+
Aug 27 19:05:29 n8n[1234]: DEBUG: Transform node processing remaining items
6+
Aug 27 19:25:29 n8n[1234]: WARN: Execution exec_384574 cancelled mid-execution after 55 minutes
7+
Aug 27 19:25:44 n8n[1234]: ERROR: Data integrity check failed - Items processed inconsistently across nodes
8+
Aug 27 19:25:49 n8n[1234]: ERROR: Expected 150 items, found 127 items at completion
9+
Aug 27 19:26:15 n8n[1234]: CRITICAL: Massive data loss detected - Expected 500 items, found 75 items
10+
Aug 27 19:26:20 n8n[1234]: ERROR: Critical workflow failure detected - 85% data loss in processing pipeline

rules/tags/categories.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,3 +244,6 @@ categories:
244244
description: |
245245
Failures that prevent MongoDB from starting successfully due to corrupted metadata, invalid configurations,
246246
or unrecoverable internal errors (e.g., WiredTiger metadata corruption). These failures often require manual repair or backup restoration.
247+
- name: workflow-automation-problem
248+
displayName: Workflow Automation Problems
249+
description: Problems related to workflow automation platforms including silent data loss, execution failures, and data integrity issues in workflow processing systems

rules/tags/tags.yaml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -844,4 +844,19 @@ tags:
844844
description: Issues with Kubernetes pod scheduling due to resource constraints or networking problems
845845
- name: cluster-scaling
846846
displayName: Cluster Scaling
847-
description: Problems related to Kubernetes cluster scaling operations and capacity management
847+
description: Problems related to Kubernetes cluster scaling operations and capacity management
848+
- name: n8n
849+
displayName: N8N
850+
description: Problems related to n8n workflow automation platform
851+
- name: workflow-automation
852+
displayName: Workflow Automation
853+
description: Problems related to workflow automation systems and platforms
854+
- name: silent-failure
855+
displayName: Silent Failure
856+
description: Problems that occur without visible error messages or alerts, making detection extremely difficult
857+
- name: production-critical
858+
displayName: Production Critical
859+
description: Issues that have severe impact on production systems and require immediate attention
860+
- name: data-integrity
861+
displayName: Data Integrity
862+
description: Problems that affect the completeness, accuracy, or consistency of data

0 commit comments

Comments
 (0)