CodeQL 文档

私人信息泄露

ID: cs/exposure-of-sensitive-information
Kind: path-problem
Security severity: 6.5
Severity: error
Precision: high
Tags:
   - security
   - external/cwe/cwe-359
Query suites:
   - csharp-code-scanning.qls
   - csharp-security-extended.qls
   - csharp-security-and-quality.qls

点击查看 CodeQL 存储库中的查询

存储在外部位置的私人信息可能更容易受到攻击,因为该位置可能不受系统其他部分相同的访问控制的保护。

示例包括日志文件、Cookie 和磁盘上的明文存储。

建议

确保私人信息仅存储在安全的数据位置。

示例

以下示例显示了一些私人数据(地址)被传递给 HTTP 处理程序。然后,此私人信息存储在日志文件中。磁盘上的此日志文件可能可供通常无权访问此私人数据的用户访问。

using System.Text;
using System.Web;
using System.Web.Security;

public class PrivateInformationHandler : IHttpHandler
{

    public void ProcessRequest(HttpContext ctx)
    {
        string address = ctx.Request.QueryString["Address1"];
        logger.Info("User has address: " + address);
    }
}

参考

  • ©2025GitHub 公司
  • 条款
  • 隐私