{"record":{"id":"e36069a7cbb36535","repo":"paascloud/paascloud-master","slug":"uac10011035","errorCode":"UAC10011035","errorMessage":"ErrorCodeEnum.UAC10011035","messagePattern":"ErrorCodeEnum\\.UAC10011035","errorType":"error_code","errorClass":"UacBizException","httpStatus":null,"severity":"error","filePath":"paascloud-provider/paascloud-provider-uac/src/main/java/com/paascloud/provider/service/impl/UacUserServiceImpl.java","lineNumber":457,"sourceCode":"\t\tString confirmPwd = userModifyPwdDto.getConfirmPwd();\n\n\t\tPreconditions.checkArgument(!PublicUtil.isEmpty(loginName), ErrorCodeEnum.UAC10011007.msg());\n\t\tPreconditions.checkArgument(!PublicUtil.isEmpty(oldPassword), \"原始密码不能为空\");\n\t\tPreconditions.checkArgument(!PublicUtil.isEmpty(newPassword), \"新密码不能为空\");\n\t\tPreconditions.checkArgument(!PublicUtil.isEmpty(confirmPwd), ErrorCodeEnum.UAC10011009.msg());\n\t\tPreconditions.checkArgument(newPassword.equals(confirmPwd), \"两次密码不一致, 请重新输入！\");\n\n\n\t\tUacUser user = uacUserMapper.findByLoginName(loginName);\n\t\tif (PublicUtil.isEmpty(user)) {\n\t\t\tthrow new UacBizException(ErrorCodeEnum.UAC10011002, loginName);\n\t\t}\n\n\t\tString oldPwd = user.getLoginPwd();\n\t\tString newEncrypt = Md5Util.encrypt(newPassword);\n\n\t\tif (!Md5Util.matches(oldPassword, oldPwd)) {\n\t\t\tthrow new UacBizException(ErrorCodeEnum.UAC10011035);\n\t\t}\n\n\t\tUacUser uacUser = new UacUser();\n\t\tif (Md5Util.matches(newPassword, oldPwd)) {\n\t\t\tthrow new UacBizException(ErrorCodeEnum.UAC10011036);\n\t\t}\n\n\t\tuacUser.setLoginPwd(Md5Util.encrypt(newPassword));\n\t\tuacUser.setId(user.getId());\n\t\tuacUser.setLoginPwd(newEncrypt);\n\t\t// 该用户已经修改过密码\n\t\tuacUser.setIsChangedPwd(Short.valueOf(\"1\"));\n\t\tuacUser.setUpdateInfo(authResDto);\n\n\t\treturn uacUserMapper.updateByPrimaryKeySelective(uacUser);\n\n\t\t// TODO 发送重置密码成功的邮件\n\t}","sourceCodeStart":439,"sourceCodeEnd":475,"githubUrl":"https://github.com/paascloud/paascloud-master/blob/781281a9503332ed3cef44ea618349d14230a127/paascloud-provider/paascloud-provider-uac/src/main/java/com/paascloud/provider/service/impl/UacUserServiceImpl.java#L439-L475","documentation":"UAC10011035 is thrown by UacUserServiceImpl.userModifyPwd when the supplied oldPassword does not match the stored MD5-hashed login password (Md5Util.matches(oldPassword, oldPwd) returns false). The user is authenticated by loginName but fails the old-password verification step required to change a password.","triggerScenarios":"Calling userModifyPwd(loginName, oldPassword, newPassword, confirmNewPassword) where oldPassword is wrong, was typed incorrectly, or does not correspond to the current stored password hash.","commonSituations":"User forgot current password; password was changed elsewhere (another session/device) so the remembered old password is stale; client sends an already-hashed password while the service expects plaintext; caps-lock/whitespace issues in input.","solutions":["Have the user re-enter the correct current password","Verify the client sends the plaintext old password (service hashes it internally with Md5Util.matches)","If the password is forgotten, use the reset-password flow (resetLoginPwd / mobile reset) instead of modify-pwd","Catch UacBizException code UAC10011035 and prompt 'old password incorrect'"],"exampleFix":"// before\n// client pre-hashes\nString old = Md5Util.encrypt(rawOldPwd);\nuacUserService.userModifyPwd(loginName, old, newPwd, confirmPwd);\n// after\nuacUserService.userModifyPwd(loginName, rawOldPwd, newPwd, confirmPwd);","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { uacUserService.userModifyPwd(loginName, oldPwd, newPwd, confirmPwd); } catch (UacBizException e) { if (\"UAC10011035\".equals(e.getCode())) { /* prompt: old password incorrect */ } }","preventionTips":["Always send plaintext old password; the service hashes it internally","Offer a reset-password path for users who forgot the current password","Trim/normalize password input client-side to avoid accidental mismatches"],"tags":["password","authentication","old-password-mismatch"],"backgroundTag":"authentication-required","analyzedSha":"781281a9503332ed3cef44ea618349d14230a127","analyzedAt":"2026-09-10T10:59:02.070Z","contentChangedAt":"2026-09-10T10:59:02.070Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}