aboutsummaryrefslogtreecommitdiff
path: root/streaming
diff options
context:
space:
mode:
authorKousuke Saruta <sarutak@oss.nttdata.co.jp>2017-01-24 23:35:23 +0100
committerHerman van Hovell <hvanhovell@databricks.com>2017-01-24 23:35:23 +0100
commit15ef3740dea3d82f64a030d4523ad542485e1453 (patch)
treed50ae2fd1a0d5e2eb5d627b427b0f3aeaeac97d6 /streaming
parentcdb691eb4da5dbf52dccf1da0ae57a9b1874f010 (diff)
downloadspark-15ef3740dea3d82f64a030d4523ad542485e1453.tar.gz
spark-15ef3740dea3d82f64a030d4523ad542485e1453.tar.bz2
spark-15ef3740dea3d82f64a030d4523ad542485e1453.zip
[SPARK-19334][SQL] Fix the code injection vulnerability related to Generator functions.
## What changes were proposed in this pull request? Similar to SPARK-15165, codegen is in danger of arbitrary code injection. The root cause is how variable names are created by codegen. In GenerateExec#codeGenAccessor, a variable name is created like as follows. ``` val value = ctx.freshName(name) ``` The variable `value` is named based on the value of the variable `name` and the value of `name` is from schema given by users so an attacker can attack with queries like as follows. ``` SELECT inline(array(cast(struct(1) AS struct<`=new Object() { {f();} public void f() {throw new RuntimeException("This exception is injected.");} public int x;}.x`:int>))) ``` In the example above, a RuntimeException is thrown but an attacker can replace it with arbitrary code. ## How was this patch tested? Added a new test case. Author: Kousuke Saruta <sarutak@oss.nttdata.co.jp> Closes #16681 from sarutak/SPARK-19334.
Diffstat (limited to 'streaming')
0 files changed, 0 insertions, 0 deletions