A potentially dangerous Request.Form value was detected from the client
使用者在頁面上提交表單到伺服器時,伺服器會檢測到一些潛在的輸入風險,例如使用富文字編輯器控制元件(RichTextBox、FreeTextBox、CuteEditor等)編輯的內容中包含有HTML標記或指令碼標記,ASP.NET頁面會丟擲一個"A potentially dangerous Request.Form value was deceted from the client"的異常。這個是ASP.NET頁面為了防範頁面注入功能的一種保護機制,要取消這種保護,常規的做法是在.aspx檔案的<%@Page %>部分加入ValidateRequest="false"屬性。但是從.NET 4.0開始你可能需要多修改一個地方,在網站的web.config檔案中加入這行配置:
<system.web> <compilation debug="true" targetFramework="4.0"/> <httpRuntime requestValidationMode="2.0"/> </system.web>
同時,你還需要確保頁面上使用者輸入的部分不會存在任何注入攻擊的程式碼,常用的做法是使用Encode處理。
相關文章
- ABP Framework Consuming HTTP APIs from a .NET ClientFrameworkHTTPAPIclient
- [20190622]收集SQLNet Message From Client資訊.txtSQLclient
- Failed to read auto-increment value from storage engineAIREM
- [20180918]等待事件SQL/Net more data from client.txt事件SQLclient
- [20180925]等待事件SQLNet more data from client 6.txt事件SQLclient
- [20180922]等待事件SQLNet more data from client 4.txt事件SQLclient
- [20180920]等待事件SQLNet more data from client 3.txt事件SQLclient
- [20180926]等待事件SQLNet more data from client 7.txt事件SQLclient
- Connect SQL Server from Linux Client using Windows Authentication and troubleshoot stepsSQLServerLinuxclientWindows
- 1149 Dangerous Goods Packaging (25分)Go
- JSON parse error: Cannot deserialize value of type `java.time.LocalDateTime` from StringJSONErrorJavaLDA
- Unknown initial character set index ‘255‘ received from server. Initial client character set can beIndexServerclient
- The request was rejected because the URL contained a potentially malicious String "%2e"AI
- Java更新資料庫報錯:Data truncation: Cannot create a JSON value from a string with CHARACTER SETJava資料庫JSON
- PAT (Advanced Level) Practice 1149 Dangerous Goods Packaging (25分)Go
- Excel匯入資料異常Cannot get a text value from a numeric cell解決辦法Excel
- smbmap報[*] Detected 0 hosts serving SMB
- Unknowm Intel PCH (Bx7110) detectedIntel
- 【問題處理】IPC Send timeout detected
- golang multiple-value xxx in single-value contextGolangContext
- ERR: node-gyp rebuild No Xcode or CLT version detectedRebuildXCode
- [20231103]sqlplus column new_value old_value.txtSQL
- [20230303]sqlplus column new_value old_value.txtSQL
- From now on
- 搭建Eureka Clientclient
- JavaScript select valueJavaScript
- @ConfigurationProperties和@Value
- Client does not support authentication protocol requested by server; consider upgrading MySQL clientclientProtocolServerIDEMySql
- Oracle分析函式-first_value()和last_value()Oracle函式AST
- flask資料庫遷移 No changes in schema detected.Flask資料庫
- System.InvalidProgramException:“Common Language Runtime detected an invalid program.”Exception
- 神From不再 From Software的內憂與外患
- 檢測到有潛在危險的Request.Form值解決辦法ORM
- from cmake make
- Array.from()
- Thrift RPC Client 流程RPCclient
- `rest-client`庫RESTclient
- Flink SQL Client初探SQLclient
- redis client原理分析Redisclient