[Security Solution][Timeline] fix Kibana DoS via Timeline Bulk Export#260265
[Security Solution][Timeline] fix Kibana DoS via Timeline Bulk Export#260265agusruidiazgd merged 4 commits intoelastic:mainfrom
Conversation
|
Pinging @elastic/security-threat-hunting-investigations (Team:Threat Hunting:Investigations) |
💚 Build Succeeded
Metrics [docs]Async chunks
|
|
Starting backport for target branches: 8.19, 9.2, 9.3 https://github.com/elastic/kibana/actions/runs/23839724833 |
💔 All backports failed
Manual backportTo create the backport manually run: Questions ?Please refer to the Backport tool documentation |
…elastic#260265) ## Summary Closes: elastic/security-team#14883 This PR fixes a DoS risk in Timeline bulk export (`POST /api/timeline/_export`). A user could send a very large list of timeline IDs (including duplicates), which caused unbounded work during export and could degrade Kibana availability. ## What changed - Added stronger request validation for export `ids`: - minimum 1 - maximum 1000 - Deduplicated incoming export IDs before processing. - Enforced export size checks on normalized IDs. - Replaced unbounded enrichment fan-out (notes/pinned events) with bounded batching. <details> <summary><strong>How to test</strong></summary> ### UI sanity test 1. Log in with a user that has timeline read access (`timeline_read`). 2. Go to **Security -> Timelines**. 3. Select one or more timelines and export from the UI. 4. Verify export still works and downloads NDJSON as expected. ### Browser Console test (while logged in to Kibana) 1) Oversized payload should fail (`400`) ```js await fetch('/api/timeline/_export?file_name=timelines_export.ndjson', { method: 'POST', credentials: 'same-origin', headers: { 'content-type': 'application/json', 'kbn-xsrf': 'true', 'elastic-api-version': '2023-10-31', }, body: JSON.stringify({ ids: Array.from({ length: 1001 }, () => crypto.randomUUID()), }), }); ``` 2) Duplicate IDs should be handled safely ```js await fetch('/api/timeline/_export?file_name=timelines_export.ndjson', { method: 'POST', credentials: 'same-origin', headers: { 'content-type': 'application/json', 'kbn-xsrf': 'true', 'elastic-api-version': '2023-10-31', }, body: JSON.stringify({ ids: ['REAL_TIMELINE_ID', 'REAL_TIMELINE_ID', 'REAL_TIMELINE_ID'], }), }); ``` --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
…elastic#260265) ## Summary Closes: elastic/security-team#14883 This PR fixes a DoS risk in Timeline bulk export (`POST /api/timeline/_export`). A user could send a very large list of timeline IDs (including duplicates), which caused unbounded work during export and could degrade Kibana availability. ## What changed - Added stronger request validation for export `ids`: - minimum 1 - maximum 1000 - Deduplicated incoming export IDs before processing. - Enforced export size checks on normalized IDs. - Replaced unbounded enrichment fan-out (notes/pinned events) with bounded batching. <details> <summary><strong>How to test</strong></summary> ### UI sanity test 1. Log in with a user that has timeline read access (`timeline_read`). 2. Go to **Security -> Timelines**. 3. Select one or more timelines and export from the UI. 4. Verify export still works and downloads NDJSON as expected. ### Browser Console test (while logged in to Kibana) 1) Oversized payload should fail (`400`) ```js await fetch('/api/timeline/_export?file_name=timelines_export.ndjson', { method: 'POST', credentials: 'same-origin', headers: { 'content-type': 'application/json', 'kbn-xsrf': 'true', 'elastic-api-version': '2023-10-31', }, body: JSON.stringify({ ids: Array.from({ length: 1001 }, () => crypto.randomUUID()), }), }); ``` 2) Duplicate IDs should be handled safely ```js await fetch('/api/timeline/_export?file_name=timelines_export.ndjson', { method: 'POST', credentials: 'same-origin', headers: { 'content-type': 'application/json', 'kbn-xsrf': 'true', 'elastic-api-version': '2023-10-31', }, body: JSON.stringify({ ids: ['REAL_TIMELINE_ID', 'REAL_TIMELINE_ID', 'REAL_TIMELINE_ID'], }), }); ``` --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
…elastic#260265) ## Summary Closes: elastic/security-team#14883 This PR fixes a DoS risk in Timeline bulk export (`POST /api/timeline/_export`). A user could send a very large list of timeline IDs (including duplicates), which caused unbounded work during export and could degrade Kibana availability. ## What changed - Added stronger request validation for export `ids`: - minimum 1 - maximum 1000 - Deduplicated incoming export IDs before processing. - Enforced export size checks on normalized IDs. - Replaced unbounded enrichment fan-out (notes/pinned events) with bounded batching. <details> <summary><strong>How to test</strong></summary> ### UI sanity test 1. Log in with a user that has timeline read access (`timeline_read`). 2. Go to **Security -> Timelines**. 3. Select one or more timelines and export from the UI. 4. Verify export still works and downloads NDJSON as expected. ### Browser Console test (while logged in to Kibana) 1) Oversized payload should fail (`400`) ```js await fetch('/api/timeline/_export?file_name=timelines_export.ndjson', { method: 'POST', credentials: 'same-origin', headers: { 'content-type': 'application/json', 'kbn-xsrf': 'true', 'elastic-api-version': '2023-10-31', }, body: JSON.stringify({ ids: Array.from({ length: 1001 }, () => crypto.randomUUID()), }), }); ``` 2) Duplicate IDs should be handled safely ```js await fetch('/api/timeline/_export?file_name=timelines_export.ndjson', { method: 'POST', credentials: 'same-origin', headers: { 'content-type': 'application/json', 'kbn-xsrf': 'true', 'elastic-api-version': '2023-10-31', }, body: JSON.stringify({ ids: ['REAL_TIMELINE_ID', 'REAL_TIMELINE_ID', 'REAL_TIMELINE_ID'], }), }); ``` --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
2 similar comments
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
Summary
Closes: https://github.com/elastic/security-team/issues/14883
This PR fixes a DoS risk in Timeline bulk export (
POST /api/timeline/_export).A user could send a very large list of timeline IDs (including duplicates), which caused unbounded work during export and could degrade Kibana availability.
What changed
ids:How to test
UI sanity test
timeline_read).Browser Console test (while logged in to Kibana)
400)