mirror of
https://github.com/hohn/codeql-javascript-multiflow.git
synced 2025-12-16 20:03:04 +01:00
Add new example to illustrate taint propagation with def-use dataflow
This commit is contained in:
committed by
=Michael Hohn
parent
c1962230c2
commit
8cdb8ef0dd
23
sample-utility-0.js
Normal file
23
sample-utility-0.js
Normal file
@@ -0,0 +1,23 @@
|
||||
var SampleUtility = function(){};
|
||||
SampleUtility.prototype = Object.extendsObject(Processor, {
|
||||
|
||||
setUserStatus: function() {
|
||||
var value = this.getParameter('value');
|
||||
|
||||
var ua = new GR('users');
|
||||
ua.query();
|
||||
|
||||
if(!ua.hasNext()){
|
||||
ua.initialize();
|
||||
ua.setValue('status',value);
|
||||
ua.insert();
|
||||
}
|
||||
else {
|
||||
ua.next();
|
||||
ua.setValue('status',value);
|
||||
ua.update();
|
||||
}
|
||||
},
|
||||
|
||||
type: 'SampleUtility'
|
||||
});
|
||||
Reference in New Issue
Block a user