且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何修复 Java Web 应用程序中的 Trust Boundary Violation 漏洞

更新时间:2023-09-11 22:27:46

根据您的用户名遵循的规则,只需使用正则表达式来验证 userName:

Simply use a regular expression to validate the userName according to the rules your usernames follow:

if(userName.matches("[0-9a-zA-Z_]+")
     session.setAttribute(Constant.USERNAME, userName);