| name | security-review |
| description | 安全审查工作流,检查 SQL 注入、越权、敏感信息泄露、依赖漏洞 |
| triggers | ["安全审查","漏洞扫描","安全审计","渗透测试"] |
安全审查工作流 — taotao-cloud-goods
适用于商品域(Goods)的安全审查,涵盖常见 Web 安全风险。
检查清单
1. SQL 注入
检查点
String sql = "SELECT * FROM t_goods WHERE name LIKE '%" + keyword + "%'";
LambdaQueryWrapper<GoodsPo> wrapper = Wrappers.lambdaQuery();
wrapper.like(GoodsPo::getName, keyword);
queryWrapper.orderBy(true, isAsc, sortField);
private static final Set<String> ALLOWED_SORT_FIELDS = Set.of("id", "create_time", "price", "sales");
if (!ALLOWED_SORT_FIELDS.contains(sortField)) {
sortField = "id";
}
2. 越权访问
检查点
@PostMapping("/{id}/publish")
public Result<Void> publish(@PathVariable Long id) {
goodsCommandService.publish(id);
return Result.success();
}
@PostMapping("/{id}/publish")
public Result<Void> publish(@PathVariable Long id) {
Long storeId = SecurityUtils.getCurrentUser().getStoreId();
goodsCommandService.publish(id, storeId);
return Result.success();
}
3. 敏感信息泄露
检查点
log.info("用户登录成功:{}", user);
log.info("用户登录成功:userId={}", user.getId());
public class UserResult {
private String password;
private String phone;
}
public class UserResult {
@JsonIgnore
private String password;
private String phone;
}
4. 文件上传安全
5. 其他安全风险
扫描命令
./gradlew dependencyCheckAnalyze
./gradlew checkstyleMain spotbugsMain pmdMain
输出格式
🔒 安全审查报告
✅ 通过:
- [项目]
⚠️ 警告:
- [项目]
❌ 漏洞:
- [严重度] [位置] [风险描述]
💡 修复建议:
- [建议]