We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
如果应用程序未正确校验用户输入的数据,则恶意用户可能会破坏应用程序的逻辑以执行针对客户端或服务器端的攻击。
脆弱代码1:
// 攻击者可以提交 lang 的内容为: // en&user_id=1# // 这将使攻击者可以随意篡改 user_id 的值 String lang = request.getParameter("lang"); GetMethod get = new GetMethod("http://www.host.com"); // 攻击者提交 lang=en&user_id=1#&user_id=123 可覆盖原始 user_id 的值 get.setQueryString("lang=" + lang + "&user_id=" + user_id); get.execute();
解决方案1:
// 参数化绑定 URIBuilder uriBuilder = new URIBuilder("http://www.host.com/viewDetails"); uriBuilder.addParameter("lang", input); uriBuilder.addParameter("user_id", userId); HttpGet httpget = new HttpGet(uriBuilder.build().toString());
脆弱逻辑2:
订单系统计算订单的价格 步骤1: 订单总价 = 商品1单价 * 商品1数量 + 商品2单价 * 商品2数量 + ... 步骤2: 钱包余额 = 钱包金额 - 订单总价 当攻击者将商品数量都篡改为负数,导致步骤1的订单总价为负数。而负负得正,攻击者不仅买入了商品并且钱包金额也增长了。
解决方案2:
应在后台严格校验订单中每一个输入参数的长度、格式、逻辑、特殊字符以及用户的权限。
The text was updated successfully, but these errors were encountered:
No branches or pull requests
如果应用程序未正确校验用户输入的数据,则恶意用户可能会破坏应用程序的逻辑以执行针对客户端或服务器端的攻击。
脆弱代码1:
解决方案1:
脆弱逻辑2:
解决方案2:
The text was updated successfully, but these errors were encountered: