Loading...
Loading...
Compare original and translation side by side
undefinedundefinedundefinedundefinedpackage.jsonrequirements.txtpyproject.tomlgo.modCargo.tomlpackage.jsonrequirements.txtpyproject.tomlgo.modCargo.tomlnpx eslint --plugin security --ext .js,.ts,.jsx,.tsx .pip install bandit
bandit -r . -f json -o bandit-report.jsongo install golang.org/x/vuln/cmd/govulncheck@latest
govulncheck ./...npx eslint --plugin security --ext .js,.ts,.jsx,.tsx .pip install bandit
bandit -r . -f json -o bandit-report.jsongo install golang.org/x/vuln/cmd/govulncheck@latest
govulncheck ./...| Pattern | Risk | Languages |
|---|---|---|
| Code injection | JS, Python |
| Command injection | Python |
| Command injection | Python |
| XSS | React |
| SQL string concatenation | SQL injection | All |
| Deserialization | Python |
| 代码模式 | 风险等级 | 适用语言 |
|---|---|---|
| 代码注入 | JS、Python |
| 命令注入 | Python |
| 命令注入 | Python |
| XSS | React |
| SQL字符串拼接 | SQL注入 | 所有语言 |
| 反序列化风险 | Python |
undefinedundefinedundefinedundefined// BAD: SQL Injection
const query = `SELECT * FROM users WHERE id = ${userId}`;
// GOOD: Parameterized query
const query = 'SELECT * FROM users WHERE id = ?';
db.query(query, [userId]);// BAD: SQL Injection
const query = `SELECT * FROM users WHERE id = ${userId}`;
// GOOD: Parameterized query
const query = 'SELECT * FROM users WHERE id = ?';
db.query(query, [userId]);// BAD: Direct HTML insertion
element.innerHTML = userInput;
// GOOD: Text content or sanitization
element.textContent = userInput;
// or
element.innerHTML = DOMPurify.sanitize(userInput);// BAD: Direct HTML insertion
element.innerHTML = userInput;
// GOOD: Text content or sanitization
element.textContent = userInput;
// or
element.innerHTML = DOMPurify.sanitize(userInput);