【问题标题】:Axapta.ExecuteStmt - Is it safe? [duplicate]Axapta.ExecuteStmt - 安全吗? [复制]
【发布时间】:2012-03-20 14:09:56
【问题描述】:

我有一些代码,它在使用 Business Connector 时使用 Axapta 对象上的 ExecuteStmt 方法,如下所示:

AxaptaRecord record = (AxaptaRecord)ax.CreateAxaptaRecord("SalesTable");
record.ExecuteStmt("select * from %1 where %1.SalesId == '" + id + "'");
while (record.Found)
{
     // do stuff
}

这很好用,但它将在面向公众的网站上,所以这是访问数据的好方法吗?它是否安全免受 SQL 注入?因为我读过这个语句将使用“forcePlaceholders”关键字,因为它不包含连接,所以它将参数化查询?

【问题讨论】:

标签: c# axapta ax


【解决方案1】:

我会说不。这仍然是 sql 注入的问题。

【讨论】:

  • 你说得对,我刚刚通过传递:S215*' || 尝试了一个“友好”的 SQL 注入%1.SalesId LIKE '*S209 作为 id 并返回所有 s215 和所有 s209 结果
猜你喜欢
  • 2014-07-25
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-11-27
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多