add jQuery options objects as sources

This commit is contained in:
Erik Krogh Kristensen
2021-04-26 20:03:14 +02:00
parent 5c37e6a435
commit 8ba5bddae8
3 changed files with 55 additions and 14 deletions

View File

@@ -13,6 +13,7 @@ module UnsafeHtmlConstruction {
private import semmle.javascript.security.dataflow.DomBasedXssCustomizations::DomBasedXss as DomBasedXss
private import semmle.javascript.security.dataflow.UnsafeJQueryPluginCustomizations::UnsafeJQueryPlugin as UnsafeJQueryPlugin
private import semmle.javascript.PackageExports as Exports
private import semmle.javascript.security.dataflow.UnsafeJQueryPlugin::UnsafeJQueryPlugin as UnsafeJQueryPlugin
/**
* A source for unsafe HTML constructed from library input.
@@ -29,6 +30,13 @@ module UnsafeHtmlConstruction {
}
}
/**
* A jQuery plugin options object, seen as a source for unsafe HTML constructed from input.
*/
class JQueryPluginOptionsAsSource extends Source {
JQueryPluginOptionsAsSource() { this instanceof UnsafeJQueryPlugin::JQueryPluginOptions }
}
/**
* A sink for unsafe HTML constructed from library input.
* This sink somehow transforms its input into a value that can cause XSS if it ends up in a XSS sink.