伺服器端範本插入

high Web App Scanning Plugin ID 112614

概要

伺服器端範本插入

說明

Web 應用程式通常依賴範本引擎來管理呈現給使用者的 HTML 頁面的動態產生。

當應用程式在其範本中內嵌並評估使用者控制的不安全輸入時,會產生用戶端範本插入 (SSTI) 弱點。

攻擊者可根據應用程式所使用的範本引擎插入特定承載,利用此弱點取得敏感資訊的存取權,或發動遠端程式碼執行攻擊。

解決方案

開發人員應避免在伺服器範本中使用使用者輸入,以防止惡意插入。如果應用程式仍需要此類型的輸入,則應盡可能優先使用無邏輯範本引擎,透過從範本中移除程式碼的邏輯部分來縮減攻擊面。最後,另一個解決方案是利用語言功能或 docker 隔離容器來建立沙箱環境。

另請參閱

https://medium.com/@adrien_jeanneau/how-i-was-able-to-list-some-internal-information-from-paypal-bugbounty-ca8d217a397c

https://owasp.org/www-project-web-security-testing-guide/stable/4-Web_Application_Security_Testing/07-Input_Validation_Testing/18-Testing_for_Server_Side_Template_Injection

https://research.securitum.com/server-side-template-injection-on-the-example-of-pebble/

https://www.okiok.com/server-side-template-injection-from-detection-to-remote-shell/

Plugin 詳細資訊

嚴重性: High

ID: 112614

類型: remote

系列: Injection

已發布: 2020/10/19

已更新: 2024/2/8

掃描範本: api, full, pci, scan

風險資訊

VPR

風險因素: Medium

分數: 5.4

CVSS v2

風險因素: High

基本分數: 9

媒介: CVSS2#AV:N/AC:L/Au:N/C:C/I:P/A:P

CVSS 評分資料來源: Tenable

CVSS v3

風險因素: High

基本分數: 8.6

媒介: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:L

CVSS 評分資料來源: Tenable

參考資訊

CWE: 1336

OWASP: 2010-A1, 2013-A1, 2017-A1, 2021-A3

WASC: Improper Input Handling

CAPEC: 10, 101, 108, 120, 13, 135, 14, 24, 250, 267, 273, 28, 3, 34, 42, 43, 45, 46, 47, 51, 52, 53, 6, 64, 67, 7, 71, 72, 76, 78, 79, 8, 80, 83, 84, 9

DISA STIG: APSC-DV-002560

HIPAA: 164.306(a)(1), 164.306(a)(2)

ISO: 27001-A.14.2.5

NIST: sp800_53-SI-10

OWASP API: 2019-API8

OWASP ASVS: 4.0.2-5.2.5

PCI-DSS: 3.2-6.5.1