簡體   English   中英

java.sql.SQLException:sql注入違規,注釋不允許:Z99938282F04071859941E18F1

[英]java.sql.SQLException: sql injection violation, comment not allow : select

正如標題所說,我使用 SQL 到 select 但報告錯誤。 下面Mapper中的SQL

<select id="selectBillDetailByBizIdAndClearType" resultMap="BaseResultMap">
    select
    <include refid="Base_Column_List" />
    from dwd_clearing_bill_detail
    where biz_detail_id in
    <foreach collection="bizDetailIdList" item="item" index="index" open="(" separator="," close=")">
      #{item}
    </foreach>
    and clear_type in
    <foreach collection="clearTypeList" item="item" index="index" open="(" separator="," close=")">
      #{item}
    </foreach>
  </select>

這是一個例外,表明以這種方式構建 SQL 語句是不安全的。 有人可以注入惡意 SQL 代碼,檢索敏感數據或修改/刪除您的數據。 請參閱https://cheatsheetseries.owasp.org/cheatsheets/SQL_Injection_Prevention_Cheat_Sheet.html

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM