【腾讯云代码分析】经典案例分享:路径穿越漏洞 #1086
xiohuang9
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
规则介绍
路径穿越漏洞(也称为目录遍历漏洞)是一种常见的Web应用程序安全漏洞,攻击者可以利用这个漏洞访问服务器上的任意文件或目录,从而导致数据泄露、篡改或删除等安全问题。
下列案例对应代码分析Xcheck工具中的规则:path_traversal——用于检测和防止路径遍历攻击,确保文件路径安全。
经典案例
代码案例
问题解析
这段代码是一个Spring Boot应用程序中的文件上传功能,但存在以下安全隐患:
AI修复建议
检查文件名称
规则使用说明
规则添加


进入页面,点击方案->规则配置 -> 自定义规则包-> 添加规则 ->搜索规则名path_traversal->选择需要添加的规则 ->批量添加规则
规则包选择

可以直接勾选对应语言的 强化安全规则包
Beta Was this translation helpful? Give feedback.
All reactions