gpt4 book ai didi

java - Veracode 问题 - 通过发送的数据暴露信息 (CWE ID 201)

转载 作者:行者123 更新时间:2023-11-30 10:31:47 29 4
gpt4 key购买 nike

代码如下

public void sendEmail(String toEmailAddr, String subject, String body) throws AppException {

Session session = Session.getDefaultInstance(props, null);
MimeMessage message = new MimeMessage(session);

try {
message.addRecipient(Message.RecipientType.TO,
new InternetAddress(toEmailAddr));
message.setSubject(subject);
message.setText(body);

Transport.send(message);

} catch (MessagingException ex) {
throw new AppException(
"Exception Occurred while processing EmailNotification.sendEmail method: ", ex);
}
}

在行“Transport.send(message);”我遇到了 vera 代码问题。如何解决问题。

最佳答案

以 veracode 形式提出的类似问题 https://community.veracode.com/s/question/0D53400003zJoPDCA0/
当从您的配置中提取敏感数据时,可能会出现此缺陷。(猜测 toEmailAddr,主题是从配置文件中提取的)。
尝试加密您的配置数据以解决问题或按照链接中给出的步骤进行操作。

关于java - Veracode 问题 - 通过发送的数据暴露信息 (CWE ID 201),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43009070/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com