Skip to content

Commit 3d072f1

Browse files
committed
fda
1 parent 0b042a5 commit 3d072f1

File tree

2 files changed

+0
-34
lines changed

2 files changed

+0
-34
lines changed

src/components/ScanResults.jsx

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,6 @@
11
import React, { useState } from 'react';
22
import { patterns, patternCategories, recommendations } from '../lib/patterns';
33

4-
// Recommendations
5-
export const recommendations = {
6-
// ... [keeping all the recommendations object content exactly as is]
7-
evalExecution: {
8-
recommendation: `
9-
**Why it Matters**: Using \`eval()\` or the Function constructor can allow malicious
10-
code to run in your application, leading to data theft or system compromise.
11-
12-
**What to Do**:
13-
1. **Avoid Dynamic Code**: Use safer alternatives (e.g., \`JSON.parse\` for JSON data).
14-
2. **Sanitize Input**: If dynamic evaluation is unavoidable, carefully whitelist
15-
valid inputs and reject anything unexpected.
16-
17-
**Example**:
18-
Instead of:
19-
\`\`\`javascript
20-
eval(userInput);
21-
\`\`\`
22-
Do:
23-
\`\`\`javascript
24-
const parsed = JSON.parse(userInput); // with validation
25-
\`\`\`
26-
`,
27-
references: [
28-
{
29-
title: 'CWE-95: Eval Injection',
30-
url: 'https://cwe.mitre.org/data/definitions/95.html'
31-
}
32-
],
33-
cwe: '95'
34-
},
35-
// ... [keeping all other recommendation entries exactly as is]
36-
};
374

385
// Severity sort order
396
const severityOrder = { CRITICAL: 0, HIGH: 1, MEDIUM: 2, LOW: 3 };

src/lib/patterns/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -962,4 +962,3 @@ Do:
962962
cwe: '926'
963963
}
964964
};
965-

0 commit comments

Comments
 (0)