使用xpath有什么安全风险?

发布于 2025-01-05 19:23:56 字数 150 浏览 1 评论 0原文

我正在尝试将 XML 列添加到我的一个关键表中,以保存敏感数据。我无法使用实体框架查询这些 xml 记录,因此我的计划是使用包含 xpath 查询的存储过程来查询它们,然后通过实体框架调用 SP。

我不知道 xpath 和 xpath 注入的安全风险。有这方面的经验吗?

I'm trying to add an XML column to one of my critical tables in order to save sensitive data. I can't query over these xml records using Entity Framework, so my plan is to query over them using Stored Procedures contains xpath queries, then call SPs by Entity Framework.

I don't know about security risks of xpath and xpath injection. Any experience about this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

っ〆星空下的拥抱 2025-01-12 19:23:56

如果您不信任用户提供任意 XPath 表达式,那么也不信任他们提供您使用字符串连接替换为 XPath 表达式的字符串。使用包含外部变量(参数)的 XPath 表达式,并允许它们提供参数值。 (并非所有 XPath API 都允许这样做,而且我恐怕不知道实体框架是什么)。

If you don't trust the user to supply an arbitrary XPath expression, then don't trust them to supply a string that you substitute into an XPath expression using string concatenation. Use an XPath expression containing external variables (parameters), and allow them to supply the parameter values. (Not all XPath APIs allow this, and I'm afraid I have no idea what Entity Framework is).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文