func_name stringlengths 2 38 | code stringlengths 63 7.98k | vul_type stringclasses 6
values | line_changes stringlengths 194 5.09k | char_changes stringlengths 83 6.45k | is_vulnerable bool 2
classes | vul_type_name stringclasses 6
values | vul_type_description stringclasses 6
values |
|---|---|---|---|---|---|---|---|
valid_id | def valid_id(opts, id_):
'''
Returns if the passed id is valid
'''
try:
return bool(clean_path(opts['pki_dir'], id_)) and clean_id(id_)
except (AttributeError, KeyError, TypeError) as e:
return False | cwe-022 | {'deleted': [{'line_no': 6, 'char_start': 88, 'char_end': 160, 'line': " return bool(clean_path(opts['pki_dir'], id_)) and clean_id(id_)\n"}, {'line_no': 7, 'char_start': 160, 'char_end': 215, 'line': ' except (AttributeError, KeyError, TypeError) as e:\n'}], 'added': [{'line_no': 6, 'char_start': 88, 'char_e... | {'deleted': [{'char_start': 141, 'char_end': 159, 'chars': ' and clean_id(id_)'}, {'char_start': 208, 'char_end': 213, 'chars': ' as e'}], 'added': [{'char_start': 96, 'char_end': 174, 'chars': "if any(x in id_ for x in ('/', '\\\\', '\\0')):\n return False\n "}]} | true | Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') | The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the... |
valid_id | def valid_id(opts, id_):
'''
Returns if the passed id is valid
'''
try:
if any(x in id_ for x in ('/', '\\', '\0')):
return False
return bool(clean_path(opts['pki_dir'], id_))
except (AttributeError, KeyError, TypeError):
return False | cwe-022 | {'deleted': [{'line_no': 6, 'char_start': 88, 'char_end': 160, 'line': " return bool(clean_path(opts['pki_dir'], id_)) and clean_id(id_)\n"}, {'line_no': 7, 'char_start': 160, 'char_end': 215, 'line': ' except (AttributeError, KeyError, TypeError) as e:\n'}], 'added': [{'line_no': 6, 'char_start': 88, 'char_e... | {'deleted': [{'char_start': 141, 'char_end': 159, 'chars': ' and clean_id(id_)'}, {'char_start': 208, 'char_end': 213, 'chars': ' as e'}], 'added': [{'char_start': 96, 'char_end': 174, 'chars': "if any(x in id_ for x in ('/', '\\\\', '\\0')):\n return False\n "}]} | false | Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') | The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the... |
get | def get(self, path):
return static_file(path, self.get_base_path()) | cwe-022 | {'deleted': [{'line_no': 2, 'char_start': 25, 'char_end': 79, 'line': ' return static_file(path, self.get_base_path())\n'}], 'added': [{'line_no': 2, 'char_start': 25, 'char_end': 65, 'line': ' path = self.sanitize_path(path)\n'}, {'line_no': 3, 'char_start': 65, 'char_end': 108, 'line': ' base_pat... | {'deleted': [{'char_start': 36, 'char_end': 37, 'chars': 'u'}, {'char_start': 44, 'char_end': 49, 'chars': 'ic_fi'}, {'char_start': 51, 'char_end': 52, 'chars': '('}, {'char_start': 56, 'char_end': 57, 'chars': ','}, {'char_start': 77, 'char_end': 78, 'chars': ')'}], 'added': [{'char_start': 33, 'char_end': 76, 'chars'... | true | Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') | The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the... |
get | def get(self, path):
path = self.sanitize_path(path)
base_paths = self.get_base_paths()
if hasattr(base_paths, 'split'):
# String, so go simple
base_path = base_paths
else:
base_path = self.get_first_base(base_paths, path)
return static_fil... | cwe-022 | {'deleted': [{'line_no': 2, 'char_start': 25, 'char_end': 79, 'line': ' return static_file(path, self.get_base_path())\n'}], 'added': [{'line_no': 2, 'char_start': 25, 'char_end': 65, 'line': ' path = self.sanitize_path(path)\n'}, {'line_no': 3, 'char_start': 65, 'char_end': 108, 'line': ' base_pat... | {'deleted': [{'char_start': 36, 'char_end': 37, 'chars': 'u'}, {'char_start': 44, 'char_end': 49, 'chars': 'ic_fi'}, {'char_start': 51, 'char_end': 52, 'chars': '('}, {'char_start': 56, 'char_end': 57, 'chars': ','}, {'char_start': 77, 'char_end': 78, 'chars': ')'}], 'added': [{'char_start': 33, 'char_end': 76, 'chars'... | false | Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') | The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the... |
is_cgi | def is_cgi(self):
"""Test whether self.path corresponds to a CGI script,
and return a boolean.
This function sets self.cgi_info to a tuple (dir, rest)
when it returns True, where dir is the directory part before
the CGI script name. Note that rest begins with a
slas... | cwe-022 | {'deleted': [{'line_no': 2, 'char_start': 22, 'char_end': 85, 'line': ' """Test whether self.path corresponds to a CGI script,\n'}, {'line_no': 3, 'char_start': 85, 'char_end': 115, 'line': ' and return a boolean.\n'}, {'line_no': 4, 'char_start': 115, 'char_end': 116, 'line': '\n'}, {'line_no': 5, 'char_... | {'deleted': [{'char_start': 83, 'char_end': 84, 'chars': ','}, {'char_start': 93, 'char_end': 98, 'chars': 'and r'}, {'char_start': 104, 'char_end': 110, 'chars': 'a bool'}, {'char_start': 113, 'char_end': 120, 'chars': '.\n\n '}, {'char_start': 121, 'char_end': 130, 'chars': ' This f'}, {'char_start': 131, 'char_... | true | Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') | The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the... |
is_cgi | def is_cgi(self):
"""Test whether self.path corresponds to a CGI script.
Returns True and updates the cgi_info attribute to the tuple
(dir, rest) if self.path requires running a CGI script.
Returns False otherwise.
The default implementation tests whether the normalized url... | cwe-022 | {'deleted': [{'line_no': 2, 'char_start': 22, 'char_end': 85, 'line': ' """Test whether self.path corresponds to a CGI script,\n'}, {'line_no': 3, 'char_start': 85, 'char_end': 115, 'line': ' and return a boolean.\n'}, {'line_no': 4, 'char_start': 115, 'char_end': 116, 'line': '\n'}, {'line_no': 5, 'char_... | {'deleted': [{'char_start': 83, 'char_end': 84, 'chars': ','}, {'char_start': 93, 'char_end': 98, 'chars': 'and r'}, {'char_start': 104, 'char_end': 110, 'chars': 'a bool'}, {'char_start': 113, 'char_end': 120, 'chars': '.\n\n '}, {'char_start': 121, 'char_end': 130, 'chars': ' This f'}, {'char_start': 131, 'char_... | false | Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') | The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the... |
deleteKey | def deleteKey(client):
"""Deletes the specified key.
Returns an error if the key doesn't exist
"""
global BAD_REQUEST
global NOT_FOUND
validateClient(client)
client_pub_key = loadClientRSAKey(client)
token_data = decodeRequestToken(request.data, client_pub_key)
if re.search('[^a-zA-Z0-9]', token_data['key']... | cwe-022 | {'deleted': [{'line_no': 5, 'char_start': 102, 'char_end': 122, 'line': '\tglobal BAD_REQUEST\n'}, {'line_no': 9, 'char_start': 165, 'char_end': 166, 'line': '\n'}, {'line_no': 12, 'char_start': 272, 'char_end': 273, 'line': '\n'}, {'line_no': 13, 'char_start': 273, 'char_end': 323, 'line': "\tif re.search('[^a-zA-Z0-9... | {'deleted': [{'char_start': 110, 'char_end': 130, 'chars': 'BAD_REQUEST\n\tglobal '}, {'char_start': 165, 'char_end': 166, 'chars': '\n'}, {'char_start': 272, 'char_end': 273, 'chars': '\n'}, {'char_start': 275, 'char_end': 278, 'chars': 'f r'}, {'char_start': 279, 'char_end': 281, 'chars': '.s'}, {'char_start': 283, '... | true | Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') | The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the... |
deleteKey | def deleteKey(client):
"""Deletes the specified key.
Returns an error if the key doesn't exist
"""
global NOT_FOUND
validateClient(client)
client_pub_key = loadClientRSAKey(client)
token_data = decodeRequestToken(request.data, client_pub_key)
validateKeyName(token_data['key'])
try:
os.remove('keys/%s/%s.ke... | cwe-022 | {'deleted': [{'line_no': 5, 'char_start': 102, 'char_end': 122, 'line': '\tglobal BAD_REQUEST\n'}, {'line_no': 9, 'char_start': 165, 'char_end': 166, 'line': '\n'}, {'line_no': 12, 'char_start': 272, 'char_end': 273, 'line': '\n'}, {'line_no': 13, 'char_start': 273, 'char_end': 323, 'line': "\tif re.search('[^a-zA-Z0-9... | {'deleted': [{'char_start': 110, 'char_end': 130, 'chars': 'BAD_REQUEST\n\tglobal '}, {'char_start': 165, 'char_end': 166, 'chars': '\n'}, {'char_start': 272, 'char_end': 273, 'chars': '\n'}, {'char_start': 275, 'char_end': 278, 'chars': 'f r'}, {'char_start': 279, 'char_end': 281, 'chars': '.s'}, {'char_start': 283, '... | false | Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') | The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the... |
set | def set(self, key, value, replace=False):
path = os.path.join(self.namespace, key)
try:
self.etcd.write(path, value, prevExist=replace)
except etcd.EtcdAlreadyExist as err:
raise CSStoreExists(str(err))
except etcd.EtcdException as err:
log_error("... | cwe-022 | {'deleted': [{'line_no': 2, 'char_start': 46, 'char_end': 95, 'line': ' path = os.path.join(self.namespace, key)\n'}], 'added': [{'line_no': 2, 'char_start': 46, 'char_end': 85, 'line': ' path = self._absolute_key(key)\n'}]} | {'deleted': [{'char_start': 61, 'char_end': 74, 'chars': 'os.path.join('}, {'char_start': 79, 'char_end': 80, 'chars': 'n'}, {'char_start': 81, 'char_end': 83, 'chars': 'me'}, {'char_start': 84, 'char_end': 87, 'chars': 'pac'}, {'char_start': 88, 'char_end': 90, 'chars': ', '}], 'added': [{'char_start': 66, 'char_end':... | true | Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') | The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the... |
set | def set(self, key, value, replace=False):
path = self._absolute_key(key)
try:
self.etcd.write(path, value, prevExist=replace)
except etcd.EtcdAlreadyExist as err:
raise CSStoreExists(str(err))
except etcd.EtcdException as err:
log_error("Error stor... | cwe-022 | {'deleted': [{'line_no': 2, 'char_start': 46, 'char_end': 95, 'line': ' path = os.path.join(self.namespace, key)\n'}], 'added': [{'line_no': 2, 'char_start': 46, 'char_end': 85, 'line': ' path = self._absolute_key(key)\n'}]} | {'deleted': [{'char_start': 61, 'char_end': 74, 'chars': 'os.path.join('}, {'char_start': 79, 'char_end': 80, 'chars': 'n'}, {'char_start': 81, 'char_end': 83, 'chars': 'me'}, {'char_start': 84, 'char_end': 87, 'chars': 'pac'}, {'char_start': 88, 'char_end': 90, 'chars': ', '}], 'added': [{'char_start': 66, 'char_end':... | false | Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') | The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the... |
_inject_key_into_fs | def _inject_key_into_fs(key, fs, execute=None):
"""Add the given public ssh key to root's authorized_keys.
key is an ssh key string.
fs is the path to the base of the filesystem into which to inject the key.
"""
sshdir = os.path.join(fs, 'root', '.ssh')
utils.execute('mkdir', '-p', sshdir, run_... | cwe-022 | {'deleted': [{'line_no': 7, 'char_start': 229, 'char_end': 275, 'line': " sshdir = os.path.join(fs, 'root', '.ssh')\n"}, {'line_no': 11, 'char_start': 455, 'char_end': 509, 'line': " keyfile = os.path.join(sshdir, 'authorized_keys')\n"}, {'line_no': 12, 'char_start': 509, 'char_end': 526, 'line': ' key_data = ... | {'deleted': [{'char_start': 243, 'char_end': 245, 'chars': 's.'}, {'char_start': 249, 'char_end': 252, 'chars': '.jo'}, {'char_start': 485, 'char_end': 488, 'chars': 'dir'}, {'char_start': 655, 'char_end': 656, 'chars': 'u'}, {'char_start': 659, 'char_end': 663, 'chars': 's.ex'}, {'char_start': 664, 'char_end': 666, 'c... | true | Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') | The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the... |
_inject_key_into_fs | def _inject_key_into_fs(key, fs, execute=None):
"""Add the given public ssh key to root's authorized_keys.
key is an ssh key string.
fs is the path to the base of the filesystem into which to inject the key.
"""
sshdir = _join_and_check_path_within_fs(fs, 'root', '.ssh')
utils.execute('mkdir', ... | cwe-022 | {'deleted': [{'line_no': 7, 'char_start': 229, 'char_end': 275, 'line': " sshdir = os.path.join(fs, 'root', '.ssh')\n"}, {'line_no': 11, 'char_start': 455, 'char_end': 509, 'line': " keyfile = os.path.join(sshdir, 'authorized_keys')\n"}, {'line_no': 12, 'char_start': 509, 'char_end': 526, 'line': ' key_data = ... | {'deleted': [{'char_start': 243, 'char_end': 245, 'chars': 's.'}, {'char_start': 249, 'char_end': 252, 'chars': '.jo'}, {'char_start': 485, 'char_end': 488, 'chars': 'dir'}, {'char_start': 655, 'char_end': 656, 'chars': 'u'}, {'char_start': 659, 'char_end': 663, 'chars': 's.ex'}, {'char_start': 664, 'char_end': 666, 'c... | false | Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') | The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the... |
init_settings | def init_settings(self, ipython_app, kernel_manager, contents_manager,
cluster_manager, session_manager, kernel_spec_manager,
config_manager,
log, base_url, default_url, settings_overrides,
jinja_env_options=None):
_tem... | cwe-079 | {'deleted': [{'line_no': 15, 'char_start': 629, 'char_end': 695, 'line': ' jenv_opt = jinja_env_options if jinja_env_options else {}\n'}], 'added': [{'line_no': 15, 'char_start': 629, 'char_end': 669, 'line': ' jenv_opt = {"autoescape": True}\n'}, {'line_no': 16, 'char_start': 669, 'char_end': 741, 'line'... | {'deleted': [], 'added': [{'char_start': 648, 'char_end': 693, 'chars': '{"autoescape": True}\n jenv_opt.update('}, {'char_start': 739, 'char_end': 741, 'chars': ')\n'}]} | true | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
init_settings | def init_settings(self, ipython_app, kernel_manager, contents_manager,
cluster_manager, session_manager, kernel_spec_manager,
config_manager,
log, base_url, default_url, settings_overrides,
jinja_env_options=None):
_tem... | cwe-079 | {'deleted': [{'line_no': 15, 'char_start': 629, 'char_end': 695, 'line': ' jenv_opt = jinja_env_options if jinja_env_options else {}\n'}], 'added': [{'line_no': 15, 'char_start': 629, 'char_end': 669, 'line': ' jenv_opt = {"autoescape": True}\n'}, {'line_no': 16, 'char_start': 669, 'char_end': 741, 'line'... | {'deleted': [], 'added': [{'char_start': 648, 'char_end': 693, 'chars': '{"autoescape": True}\n jenv_opt.update('}, {'char_start': 739, 'char_end': 741, 'chars': ')\n'}]} | false | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
get | @auth.public
def get(self, build_id):
try:
build_id = int(build_id)
except ValueError as ex:
self.response.write(ex.message)
self.abort(400)
build = model.Build.get_by_id(build_id)
can_view = build and user.can_view_build_async(build).get_result()
if not can_view:
if au... | cwe-079 | {'deleted': [{'line_no': 5, 'char_start': 82, 'char_end': 111, 'line': ' except ValueError as ex:\n'}, {'line_no': 6, 'char_start': 111, 'char_end': 149, 'line': ' self.response.write(ex.message)\n'}, {'line_no': 14, 'char_start': 360, 'char_end': 435, 'line': ' return self.redirect(gae_users.create_logi... | {'deleted': [{'char_start': 103, 'char_end': 109, 'chars': ' as ex'}, {'char_start': 137, 'char_end': 144, 'chars': 'ex.mess'}, {'char_start': 145, 'char_end': 147, 'chars': 'ge'}, {'char_start': 389, 'char_end': 394, 'chars': 'gae_u'}, {'char_start': 396, 'char_end': 398, 'chars': 'rs'}], 'added': [{'char_start': 131,... | true | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
get | @auth.public
def get(self, build_id):
try:
build_id = int(build_id)
except ValueError:
self.response.write('invalid build id')
self.abort(400)
build = model.Build.get_by_id(build_id)
can_view = build and user.can_view_build_async(build).get_result()
if not can_view:
if ... | cwe-079 | {'deleted': [{'line_no': 5, 'char_start': 82, 'char_end': 111, 'line': ' except ValueError as ex:\n'}, {'line_no': 6, 'char_start': 111, 'char_end': 149, 'line': ' self.response.write(ex.message)\n'}, {'line_no': 14, 'char_start': 360, 'char_end': 435, 'line': ' return self.redirect(gae_users.create_logi... | {'deleted': [{'char_start': 103, 'char_end': 109, 'chars': ' as ex'}, {'char_start': 137, 'char_end': 144, 'chars': 'ex.mess'}, {'char_start': 145, 'char_end': 147, 'chars': 'ge'}, {'char_start': 389, 'char_end': 394, 'chars': 'gae_u'}, {'char_start': 396, 'char_end': 398, 'chars': 'rs'}], 'added': [{'char_start': 131,... | false | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
index | def index(request, is_mobile=False):
hue_collections = DashboardController(request.user).get_search_collections()
collection_id = request.GET.get('collection')
if not hue_collections or not collection_id:
return admin_collections(request, True, is_mobile)
try:
collection_doc = Document2.objects.get(id... | cwe-079 | {'deleted': [{'line_no': 22, 'char_start': 814, 'char_end': 863, 'line': " query['qs'][0]['q'] = request.GET.get('q')\n"}, {'line_no': 24, 'char_start': 891, 'char_end': 933, 'line': " query['qd'] = request.GET.get('qd')\n"}, {'line_no': 39, 'char_start': 1285, 'char_end': 1351, 'line': " 'is_owner': colle... | {'deleted': [], 'added': [{'char_start': 842, 'char_end': 850, 'chars': 'antixss('}, {'char_start': 869, 'char_end': 874, 'chars': ", '')"}, {'char_start': 924, 'char_end': 932, 'chars': 'antixss('}, {'char_start': 952, 'char_end': 957, 'chars': ", '')"}, {'char_start': 1326, 'char_end': 1394, 'chars': ' collection_doc... | true | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
index | def index(request, is_mobile=False):
hue_collections = DashboardController(request.user).get_search_collections()
collection_id = request.GET.get('collection')
if not hue_collections or not collection_id:
return admin_collections(request, True, is_mobile)
try:
collection_doc = Document2.objects.get(id... | cwe-079 | {'deleted': [{'line_no': 22, 'char_start': 814, 'char_end': 863, 'line': " query['qs'][0]['q'] = request.GET.get('q')\n"}, {'line_no': 24, 'char_start': 891, 'char_end': 933, 'line': " query['qd'] = request.GET.get('qd')\n"}, {'line_no': 39, 'char_start': 1285, 'char_end': 1351, 'line': " 'is_owner': colle... | {'deleted': [], 'added': [{'char_start': 842, 'char_end': 850, 'chars': 'antixss('}, {'char_start': 869, 'char_end': 874, 'chars': ", '')"}, {'char_start': 924, 'char_end': 932, 'chars': 'antixss('}, {'char_start': 952, 'char_end': 957, 'chars': ", '')"}, {'char_start': 1326, 'char_end': 1394, 'chars': ' collection_doc... | false | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
respond_error | def respond_error(self, context, exception):
context.respond_server_error()
stack = traceback.format_exc()
return """
<html>
<body>
<style>
body {
font-family: sans-serif;
color: #888;
... | cwe-079 | {'deleted': [{'line_no': 33, 'char_start': 871, 'char_end': 890, 'line': ' """ % stack\n'}], 'added': [{'line_no': 33, 'char_start': 871, 'char_end': 902, 'line': ' """ % cgi.escape(stack)'}]} | {'deleted': [], 'added': [{'char_start': 885, 'char_end': 896, 'chars': 'cgi.escape('}, {'char_start': 901, 'char_end': 902, 'chars': ')'}]} | true | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
respond_error | def respond_error(self, context, exception):
context.respond_server_error()
stack = traceback.format_exc()
return """
<html>
<body>
<style>
body {
font-family: sans-serif;
color: #888;
... | cwe-079 | {'deleted': [{'line_no': 33, 'char_start': 871, 'char_end': 890, 'line': ' """ % stack\n'}], 'added': [{'line_no': 33, 'char_start': 871, 'char_end': 902, 'line': ' """ % cgi.escape(stack)'}]} | {'deleted': [], 'added': [{'char_start': 885, 'char_end': 896, 'chars': 'cgi.escape('}, {'char_start': 901, 'char_end': 902, 'chars': ')'}]} | false | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
edit_bundle | @check_document_access_permission()
def edit_bundle(request):
bundle_id = request.GET.get('bundle')
doc = None
if bundle_id:
doc = Document2.objects.get(id=bundle_id)
bundle = Bundle(document=doc)
else:
bundle = Bundle()
coordinators = [dict([('uuid', d.content_object.uuid), ('name', d.content... | cwe-079 | {'deleted': [{'line_no': 16, 'char_start': 498, 'char_end': 532, 'line': " 'bundle_json': bundle.json,\n"}, {'line_no': 17, 'char_start': 532, 'char_end': 585, 'line': " 'coordinators_json': json.dumps(coordinators),\n"}], 'added': [{'line_no': 16, 'char_start': 498, 'char_end': 543, 'line': " 'bundle_js... | {'deleted': [], 'added': [{'char_start': 530, 'char_end': 541, 'chars': '_for_html()'}, {'char_start': 593, 'char_end': 617, 'chars': ', cls=JSONEncoderForHTML'}]} | true | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
edit_bundle | @check_document_access_permission()
def edit_bundle(request):
bundle_id = request.GET.get('bundle')
doc = None
if bundle_id:
doc = Document2.objects.get(id=bundle_id)
bundle = Bundle(document=doc)
else:
bundle = Bundle()
coordinators = [dict([('uuid', d.content_object.uuid), ('name', d.content... | cwe-079 | {'deleted': [{'line_no': 16, 'char_start': 498, 'char_end': 532, 'line': " 'bundle_json': bundle.json,\n"}, {'line_no': 17, 'char_start': 532, 'char_end': 585, 'line': " 'coordinators_json': json.dumps(coordinators),\n"}], 'added': [{'line_no': 16, 'char_start': 498, 'char_end': 543, 'line': " 'bundle_js... | {'deleted': [], 'added': [{'char_start': 530, 'char_end': 541, 'chars': '_for_html()'}, {'char_start': 593, 'char_end': 617, 'chars': ', cls=JSONEncoderForHTML'}]} | false | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
history_data | def history_data(start_time, offset=None):
"""Return history data.
Arguments:
start_time: select history starting from this timestamp.
offset: number of items to skip
"""
# history atimes are stored as ints, ensure start_time is not a float
start_time = int(start_time)
hist = ob... | cwe-079 | {'deleted': [{'line_no': 18, 'char_start': 603, 'char_end': 674, 'line': ' return [{"url": e.url, "title": e.title or e.url, "time": e.atime}\n'}, {'line_no': 19, 'char_start': 674, 'char_end': 703, 'line': ' for e in entries]\n'}], 'added': [{'line_no': 18, 'char_start': 603, 'char_end': 643, 'line': ' ... | {'deleted': [{'char_start': 673, 'char_end': 685, 'chars': '\n '}], 'added': [{'char_start': 623, 'char_end': 635, 'chars': 'html.escape('}, {'char_start': 640, 'char_end': 641, 'chars': ')'}, {'char_start': 642, 'char_end': 655, 'chars': '\n '}, {'char_start': 665, 'char_end': 677, 'chars': 'html.... | true | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
history_data | def history_data(start_time, offset=None):
"""Return history data.
Arguments:
start_time: select history starting from this timestamp.
offset: number of items to skip
"""
# history atimes are stored as ints, ensure start_time is not a float
start_time = int(start_time)
hist = ob... | cwe-079 | {'deleted': [{'line_no': 18, 'char_start': 603, 'char_end': 674, 'line': ' return [{"url": e.url, "title": e.title or e.url, "time": e.atime}\n'}, {'line_no': 19, 'char_start': 674, 'char_end': 703, 'line': ' for e in entries]\n'}], 'added': [{'line_no': 18, 'char_start': 603, 'char_end': 643, 'line': ' ... | {'deleted': [{'char_start': 673, 'char_end': 685, 'chars': '\n '}], 'added': [{'char_start': 623, 'char_end': 635, 'chars': 'html.escape('}, {'char_start': 640, 'char_end': 641, 'chars': ')'}, {'char_start': 642, 'char_end': 655, 'chars': '\n '}, {'char_start': 665, 'char_end': 677, 'chars': 'html.... | false | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
json_dumps | @register.filter
def json_dumps(value, indent=None):
if isinstance(value, QuerySet):
result = serialize('json', value, indent=indent)
else:
result = json.dumps(value, indent=indent, cls=DjbletsJSONEncoder)
return mark_safe(result) | cwe-079 | {'deleted': [{'line_no': 8, 'char_start': 231, 'char_end': 259, 'line': ' return mark_safe(result)\n'}], 'added': [{'line_no': 8, 'char_start': 231, 'char_end': 299, 'line': ' return mark_safe(force_text(result).translate(_safe_js_escapes))\n'}]} | {'deleted': [], 'added': [{'char_start': 252, 'char_end': 263, 'chars': 'force_text('}, {'char_start': 270, 'char_end': 299, 'chars': '.translate(_safe_js_escapes))'}]} | true | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
json_dumps | @register.filter
def json_dumps(value, indent=None):
if isinstance(value, QuerySet):
result = serialize('json', value, indent=indent)
else:
result = json.dumps(value, indent=indent, cls=DjbletsJSONEncoder)
return mark_safe(force_text(result).translate(_safe_js_escapes)) | cwe-079 | {'deleted': [{'line_no': 8, 'char_start': 231, 'char_end': 259, 'line': ' return mark_safe(result)\n'}], 'added': [{'line_no': 8, 'char_start': 231, 'char_end': 299, 'line': ' return mark_safe(force_text(result).translate(_safe_js_escapes))\n'}]} | {'deleted': [], 'added': [{'char_start': 252, 'char_end': 263, 'chars': 'force_text('}, {'char_start': 270, 'char_end': 299, 'chars': '.translate(_safe_js_escapes))'}]} | false | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
htmlvalue | def htmlvalue(self, val):
return self.block.render_basic(val) | cwe-079 | {'deleted': [{'line_no': 2, 'char_start': 30, 'char_end': 73, 'line': ' return self.block.render_basic(val)\n'}], 'added': [{'line_no': 2, 'char_start': 30, 'char_end': 42, 'line': ' """\n'}, {'line_no': 3, 'char_start': 42, 'char_end': 122, 'line': ' Return an HTML representation of this block tha... | {'deleted': [], 'added': [{'char_start': 38, 'char_end': 68, 'chars': '"""\n Return an HTML rep'}, {'char_start': 70, 'char_end': 73, 'chars': 'sen'}, {'char_start': 74, 'char_end': 117, 'chars': 'ation of this block that is safe to be incl'}, {'char_start': 118, 'char_end': 138, 'chars': 'ded\n in compa'... | true | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
htmlvalue | def htmlvalue(self, val):
"""
Return an HTML representation of this block that is safe to be included
in comparison views
"""
return escape(text_from_html(self.block.render_basic(val))) | cwe-079 | {'deleted': [{'line_no': 2, 'char_start': 30, 'char_end': 73, 'line': ' return self.block.render_basic(val)\n'}], 'added': [{'line_no': 2, 'char_start': 30, 'char_end': 42, 'line': ' """\n'}, {'line_no': 3, 'char_start': 42, 'char_end': 122, 'line': ' Return an HTML representation of this block tha... | {'deleted': [], 'added': [{'char_start': 38, 'char_end': 68, 'chars': '"""\n Return an HTML rep'}, {'char_start': 70, 'char_end': 73, 'chars': 'sen'}, {'char_start': 74, 'char_end': 117, 'chars': 'ation of this block that is safe to be incl'}, {'char_start': 118, 'char_end': 138, 'chars': 'ded\n in compa'... | false | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
gravatar | @register.tag
@basictag(takes_context=True)
def gravatar(context, user, size=None):
"""
Outputs the HTML for displaying a user's gravatar.
This can take an optional size of the image (defaults to 80 if not
specified).
This is also influenced by the following settings:
GRAVATAR_SIZE - D... | cwe-079 | {'deleted': [{'line_no': 22, 'char_start': 698, 'char_end': 763, 'line': ' return (\'<img src="%s" width="%s" height="%s" alt="%s" \'\n'}, {'line_no': 23, 'char_start': 763, 'char_end': 807, 'line': ' \' class="gravatar"/>\' %\n'}, {'line_no': 24, 'char_start': 807, 'char_end': 881, 'line': ' ... | {'deleted': [{'char_start': 725, 'char_end': 727, 'chars': '%s'}, {'char_start': 736, 'char_end': 738, 'chars': '%s'}, {'char_start': 748, 'char_end': 750, 'chars': '%s'}, {'char_start': 757, 'char_end': 759, 'chars': '%s'}, {'char_start': 775, 'char_end': 779, 'chars': ' '}, {'char_start': 780, 'char_end': 785, 'ch... | true | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
gravatar | @register.tag
@basictag(takes_context=True)
def gravatar(context, user, size=None):
"""
Outputs the HTML for displaying a user's gravatar.
This can take an optional size of the image (defaults to 80 if not
specified).
This is also influenced by the following settings:
GRAVATAR_SIZE - D... | cwe-079 | {'deleted': [{'line_no': 22, 'char_start': 698, 'char_end': 763, 'line': ' return (\'<img src="%s" width="%s" height="%s" alt="%s" \'\n'}, {'line_no': 23, 'char_start': 763, 'char_end': 807, 'line': ' \' class="gravatar"/>\' %\n'}, {'line_no': 24, 'char_start': 807, 'char_end': 881, 'line': ' ... | {'deleted': [{'char_start': 725, 'char_end': 727, 'chars': '%s'}, {'char_start': 736, 'char_end': 738, 'chars': '%s'}, {'char_start': 748, 'char_end': 750, 'chars': '%s'}, {'char_start': 757, 'char_end': 759, 'chars': '%s'}, {'char_start': 775, 'char_end': 779, 'chars': ' '}, {'char_start': 780, 'char_end': 785, 'ch... | false | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
is_safe_url | def is_safe_url(url, host=None):
"""
Return ``True`` if the url is a safe redirection (i.e. it doesn't point to
a different host and uses a safe scheme).
Always returns ``False`` on an empty url.
"""
if url is not None:
url = url.strip()
if not url:
return False
# Chrome... | cwe-079 | {'deleted': [{'line_no': 13, 'char_start': 346, 'char_end': 379, 'line': " url = url.replace('\\\\', '/')\n"}], 'added': [{'line_no': 14, 'char_start': 444, 'char_end': 525, 'line': " return _is_safe_url(url, host) and _is_safe_url(url.replace('\\\\', '/'), host)\n"}]} | {'deleted': [{'char_start': 345, 'char_end': 346, 'chars': '\n'}, {'char_start': 347, 'char_end': 396, 'chars': " url = url.replace('\\\\', '/')\n # Chrome cons"}, {'char_start': 397, 'char_end': 403, 'chars': 'ders a'}, {'char_start': 404, 'char_end': 405, 'chars': 'y'}, {'char_start': 406, 'char_end': 422, 'char... | true | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
is_safe_url | def is_safe_url(url, host=None):
"""
Return ``True`` if the url is a safe redirection (i.e. it doesn't point to
a different host and uses a safe scheme).
Always returns ``False`` on an empty url.
"""
if url is not None:
url = url.strip()
if not url:
return False
# Chrome... | cwe-079 | {'deleted': [{'line_no': 13, 'char_start': 346, 'char_end': 379, 'line': " url = url.replace('\\\\', '/')\n"}], 'added': [{'line_no': 14, 'char_start': 444, 'char_end': 525, 'line': " return _is_safe_url(url, host) and _is_safe_url(url.replace('\\\\', '/'), host)\n"}]} | {'deleted': [{'char_start': 345, 'char_end': 346, 'chars': '\n'}, {'char_start': 347, 'char_end': 396, 'chars': " url = url.replace('\\\\', '/')\n # Chrome cons"}, {'char_start': 397, 'char_end': 403, 'chars': 'ders a'}, {'char_start': 404, 'char_end': 405, 'chars': 'y'}, {'char_start': 406, 'char_end': 422, 'char... | false | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
get_context_data | def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context['comments'] = self.object.comment_set.all().order_by('-time')
context['form'] = self.get_form()
context['md'] = markdown(self.object.content,
extensions=[
... | cwe-079 | {'deleted': [{'line_no': 5, 'char_start': 215, 'char_end': 269, 'line': " context['md'] = markdown(self.object.content,\n"}, {'line_no': 6, 'char_start': 269, 'char_end': 315, 'line': ' extensions=[\n'}, {'line_no': 7, 'char_start': 315, 'char_end': 381, 'line': " ... | {'deleted': [{'char_start': 239, 'char_end': 240, 'chars': 'm'}, {'char_start': 241, 'char_end': 243, 'chars': 'rk'}, {'char_start': 244, 'char_end': 247, 'chars': 'own'}, {'char_start': 267, 'char_end': 550, 'chars': ",\n extensions=[\n 'markdown.exte... | true | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
get_context_data | def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context['comments'] = self.object.comment_set.all().order_by('-time')
context['form'] = self.get_form()
context['md'] = safe_md(self.object.content)
return context | cwe-079 | {'deleted': [{'line_no': 5, 'char_start': 215, 'char_end': 269, 'line': " context['md'] = markdown(self.object.content,\n"}, {'line_no': 6, 'char_start': 269, 'char_end': 315, 'line': ' extensions=[\n'}, {'line_no': 7, 'char_start': 315, 'char_end': 381, 'line': " ... | {'deleted': [{'char_start': 239, 'char_end': 240, 'chars': 'm'}, {'char_start': 241, 'char_end': 243, 'chars': 'rk'}, {'char_start': 244, 'char_end': 247, 'chars': 'own'}, {'char_start': 267, 'char_end': 550, 'chars': ",\n extensions=[\n 'markdown.exte... | false | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
edit_workflow | @check_document_access_permission()
def edit_workflow(request):
workflow_id = request.GET.get('workflow')
if workflow_id:
wid = {}
if workflow_id.isdigit():
wid['id'] = workflow_id
else:
wid['uuid'] = workflow_id
doc = Document2.objects.get(type='oozie-workflow2', **wid)
workflow ... | cwe-079 | {'deleted': [{'line_no': 30, 'char_start': 743, 'char_end': 801, 'line': " 'layout_json': json.dumps(workflow_data['layout']),\n"}, {'line_no': 31, 'char_start': 801, 'char_end': 863, 'line': " 'workflow_json': json.dumps(workflow_data['workflow']),\n"}, {'line_no': 32, 'char_start': 863, 'char_end': 933, 'li... | {'deleted': [], 'added': [{'char_start': 798, 'char_end': 822, 'chars': ', cls=JSONEncoderForHTML'}, {'char_start': 884, 'char_end': 908, 'chars': ', cls=JSONEncoderForHTML'}, {'char_start': 978, 'char_end': 1002, 'chars': ', cls=JSONEncoderForHTML'}, {'char_start': 1074, 'char_end': 1098, 'chars': ', cls=JSONEncoderFo... | true | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
edit_workflow | @check_document_access_permission()
def edit_workflow(request):
workflow_id = request.GET.get('workflow')
if workflow_id:
wid = {}
if workflow_id.isdigit():
wid['id'] = workflow_id
else:
wid['uuid'] = workflow_id
doc = Document2.objects.get(type='oozie-workflow2', **wid)
workflow ... | cwe-079 | {'deleted': [{'line_no': 30, 'char_start': 743, 'char_end': 801, 'line': " 'layout_json': json.dumps(workflow_data['layout']),\n"}, {'line_no': 31, 'char_start': 801, 'char_end': 863, 'line': " 'workflow_json': json.dumps(workflow_data['workflow']),\n"}, {'line_no': 32, 'char_start': 863, 'char_end': 933, 'li... | {'deleted': [], 'added': [{'char_start': 798, 'char_end': 822, 'chars': ', cls=JSONEncoderForHTML'}, {'char_start': 884, 'char_end': 908, 'chars': ', cls=JSONEncoderForHTML'}, {'char_start': 978, 'char_end': 1002, 'chars': ', cls=JSONEncoderForHTML'}, {'char_start': 1074, 'char_end': 1098, 'chars': ', cls=JSONEncoderFo... | false | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
simple_search | @classmethod
def simple_search(cls, query, using=None, index=None):
es_search = cls.search(using=using, index=index)
es_query = cls.get_es_query(query=query)
highlighted_fields = [f.split('^', 1)[0] for f in cls.search_fields]
es_search = es_search.query(es_query).highlight(*hig... | cwe-079 | {'deleted': [{'line_no': 6, 'char_start': 259, 'char_end': 260, 'line': '\n'}], 'added': [{'line_no': 3, 'char_start': 76, 'char_end': 88, 'line': ' """\n'}, {'line_no': 4, 'char_start': 88, 'char_end': 124, 'line': ' Do a search without facets.\n'}, {'line_no': 5, 'char_start': 124, 'char_end': 125, 'lin... | {'deleted': [{'char_start': 259, 'char_end': 260, 'chars': '\n'}], 'added': [{'char_start': 84, 'char_end': 240, 'chars': '"""\n Do a search without facets.\n\n This is used in:\n\n * The Docsearch API\n * The Project Admin Search page\n """\n\n '}, {'char_start': 289, 'char_en... | true | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
simple_search | @classmethod
def simple_search(cls, query, using=None, index=None):
"""
Do a search without facets.
This is used in:
* The Docsearch API
* The Project Admin Search page
"""
es_search = cls.search(using=using, index=index)
es_search = es_search.h... | cwe-079 | {'deleted': [{'line_no': 6, 'char_start': 259, 'char_end': 260, 'line': '\n'}], 'added': [{'line_no': 3, 'char_start': 76, 'char_end': 88, 'line': ' """\n'}, {'line_no': 4, 'char_start': 88, 'char_end': 124, 'line': ' Do a search without facets.\n'}, {'line_no': 5, 'char_start': 124, 'char_end': 125, 'lin... | {'deleted': [{'char_start': 259, 'char_end': 260, 'chars': '\n'}], 'added': [{'char_start': 84, 'char_end': 240, 'chars': '"""\n Do a search without facets.\n\n This is used in:\n\n * The Docsearch API\n * The Project Admin Search page\n """\n\n '}, {'char_start': 289, 'char_en... | false | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
mode_receive | def mode_receive(self, request):
"""
This is called by render_POST when the client is telling us
that it is ready to receive data as soon as it is available.
This is the basis of a long-polling (comet) mechanism: the
server will wait to reply until data is available.
... | cwe-079 | {'deleted': [{'line_no': 12, 'char_start': 389, 'char_end': 438, 'line': " csessid = request.args.get('csessid')[0]\n"}], 'added': [{'line_no': 12, 'char_start': 389, 'char_end': 446, 'line': " csessid = cgi.escape(request.args['csessid'][0])\n"}]} | {'deleted': [{'char_start': 419, 'char_end': 424, 'chars': '.get('}, {'char_start': 433, 'char_end': 434, 'chars': ')'}], 'added': [{'char_start': 407, 'char_end': 418, 'chars': 'cgi.escape('}, {'char_start': 430, 'char_end': 431, 'chars': '['}, {'char_start': 440, 'char_end': 441, 'chars': ']'}, {'char_start': 444, 'c... | true | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
mode_receive | def mode_receive(self, request):
"""
This is called by render_POST when the client is telling us
that it is ready to receive data as soon as it is available.
This is the basis of a long-polling (comet) mechanism: the
server will wait to reply until data is available.
... | cwe-079 | {'deleted': [{'line_no': 12, 'char_start': 389, 'char_end': 438, 'line': " csessid = request.args.get('csessid')[0]\n"}], 'added': [{'line_no': 12, 'char_start': 389, 'char_end': 446, 'line': " csessid = cgi.escape(request.args['csessid'][0])\n"}]} | {'deleted': [{'char_start': 419, 'char_end': 424, 'chars': '.get('}, {'char_start': 433, 'char_end': 434, 'chars': ')'}], 'added': [{'char_start': 407, 'char_end': 418, 'chars': 'cgi.escape('}, {'char_start': 430, 'char_end': 431, 'chars': '['}, {'char_start': 440, 'char_end': 441, 'chars': ']'}, {'char_start': 444, 'c... | false | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
edit_coordinator | @check_document_access_permission()
def edit_coordinator(request):
coordinator_id = request.GET.get('coordinator')
doc = None
if coordinator_id:
doc = Document2.objects.get(id=coordinator_id)
coordinator = Coordinator(document=doc)
else:
coordinator = Coordinator()
api = get_oozie(request.user... | cwe-079 | {'deleted': [{'line_no': 27, 'char_start': 915, 'char_end': 959, 'line': " 'coordinator_json': coordinator.json,\n"}, {'line_no': 28, 'char_start': 959, 'char_end': 1029, 'line': " 'credentials_json': json.dumps(credentials.credentials.keys()),\n"}, {'line_no': 29, 'char_start': 1029, 'char_end': 1076, 'line'... | {'deleted': [], 'added': [{'char_start': 957, 'char_end': 968, 'chars': '_for_html()'}, {'char_start': 1037, 'char_end': 1061, 'chars': ', cls=JSONEncoderForHTML'}, {'char_start': 1108, 'char_end': 1132, 'chars': ', cls=JSONEncoderForHTML'}]} | true | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
edit_coordinator | @check_document_access_permission()
def edit_coordinator(request):
coordinator_id = request.GET.get('coordinator')
doc = None
if coordinator_id:
doc = Document2.objects.get(id=coordinator_id)
coordinator = Coordinator(document=doc)
else:
coordinator = Coordinator()
api = get_oozie(request.user... | cwe-079 | {'deleted': [{'line_no': 27, 'char_start': 915, 'char_end': 959, 'line': " 'coordinator_json': coordinator.json,\n"}, {'line_no': 28, 'char_start': 959, 'char_end': 1029, 'line': " 'credentials_json': json.dumps(credentials.credentials.keys()),\n"}, {'line_no': 29, 'char_start': 1029, 'char_end': 1076, 'line'... | {'deleted': [], 'added': [{'char_start': 957, 'char_end': 968, 'chars': '_for_html()'}, {'char_start': 1037, 'char_end': 1061, 'chars': ', cls=JSONEncoderForHTML'}, {'char_start': 1108, 'char_end': 1132, 'chars': ', cls=JSONEncoderForHTML'}]} | false | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
_keyify | def _keyify(key):
return _key_pattern.sub(' ', key.lower()) | cwe-079 | {'deleted': [{'line_no': 2, 'char_start': 18, 'char_end': 63, 'line': " return _key_pattern.sub(' ', key.lower())\n"}], 'added': [{'line_no': 2, 'char_start': 18, 'char_end': 60, 'line': ' key = escape(key.lower(), quote=True)\n'}, {'line_no': 3, 'char_start': 60, 'char_end': 97, 'line': " return _key_pattern.... | {'deleted': [{'char_start': 54, 'char_end': 62, 'chars': '.lower()'}], 'added': [{'char_start': 22, 'char_end': 64, 'chars': 'key = escape(key.lower(), quote=True)\n '}]} | true | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
_keyify | def _keyify(key):
key = escape(key.lower(), quote=True)
return _key_pattern.sub(' ', key) | cwe-079 | {'deleted': [{'line_no': 2, 'char_start': 18, 'char_end': 63, 'line': " return _key_pattern.sub(' ', key.lower())\n"}], 'added': [{'line_no': 2, 'char_start': 18, 'char_end': 60, 'line': ' key = escape(key.lower(), quote=True)\n'}, {'line_no': 3, 'char_start': 60, 'char_end': 97, 'line': " return _key_pattern.... | {'deleted': [{'char_start': 54, 'char_end': 62, 'chars': '.lower()'}], 'added': [{'char_start': 22, 'char_end': 64, 'chars': 'key = escape(key.lower(), quote=True)\n '}]} | false | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
batch_edit_translations | @login_required(redirect_field_name='', login_url='/403')
@require_POST
@require_AJAX
@transaction.atomic
def batch_edit_translations(request):
"""Perform an action on a list of translations.
Available actions are defined in `ACTIONS_FN_MAP`. Arguments to this view
are defined in `models.BatchActionsForm`.... | cwe-079 | {'deleted': [{'line_no': 14, 'char_start': 406, 'char_end': 467, 'line': ' return HttpResponseBadRequest(form.errors.as_json())\n'}], 'added': [{'line_no': 14, 'char_start': 406, 'char_end': 483, 'line': ' return HttpResponseBadRequest(form.errors.as_json(escape_html=True))\n'}]} | {'deleted': [], 'added': [{'char_start': 464, 'char_end': 480, 'chars': 'escape_html=True'}]} | true | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
batch_edit_translations | @login_required(redirect_field_name='', login_url='/403')
@require_POST
@require_AJAX
@transaction.atomic
def batch_edit_translations(request):
"""Perform an action on a list of translations.
Available actions are defined in `ACTIONS_FN_MAP`. Arguments to this view
are defined in `models.BatchActionsForm`.... | cwe-079 | {'deleted': [{'line_no': 14, 'char_start': 406, 'char_end': 467, 'line': ' return HttpResponseBadRequest(form.errors.as_json())\n'}], 'added': [{'line_no': 14, 'char_start': 406, 'char_end': 483, 'line': ' return HttpResponseBadRequest(form.errors.as_json(escape_html=True))\n'}]} | {'deleted': [], 'added': [{'char_start': 464, 'char_end': 480, 'chars': 'escape_html=True'}]} | false | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
make_eb_config | def make_eb_config(application_name, default_region):
# Capture our current directory
UTILS_DIR = os.path.dirname(os.path.abspath(__file__))
# Create the jinja2 environment.
# Notice the use of trim_blocks, which greatly helps control whitespace.
j2_env = Environment(loader=FileSystemLoader(UTILS_DI... | cwe-079 | {'deleted': [{'line_no': 6, 'char_start': 263, 'char_end': 324, 'line': ' j2_env = Environment(loader=FileSystemLoader(UTILS_DIR))\n'}], 'added': [{'line_no': 6, 'char_start': 263, 'char_end': 341, 'line': ' j2_env = Environment(loader=FileSystemLoader(UTILS_DIR), autoescape=True)\n'}]} | {'deleted': [], 'added': [{'char_start': 322, 'char_end': 339, 'chars': ', autoescape=True'}]} | true | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
make_eb_config | def make_eb_config(application_name, default_region):
# Capture our current directory
UTILS_DIR = os.path.dirname(os.path.abspath(__file__))
# Create the jinja2 environment.
# Notice the use of trim_blocks, which greatly helps control whitespace.
j2_env = Environment(loader=FileSystemLoader(UTILS_DI... | cwe-079 | {'deleted': [{'line_no': 6, 'char_start': 263, 'char_end': 324, 'line': ' j2_env = Environment(loader=FileSystemLoader(UTILS_DIR))\n'}], 'added': [{'line_no': 6, 'char_start': 263, 'char_end': 341, 'line': ' j2_env = Environment(loader=FileSystemLoader(UTILS_DIR), autoescape=True)\n'}]} | {'deleted': [], 'added': [{'char_start': 322, 'char_end': 339, 'chars': ', autoescape=True'}]} | false | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
mode_keepalive | def mode_keepalive(self, request):
"""
This is called by render_POST when the
client is replying to the keepalive.
"""
csessid = request.args.get('csessid')[0]
self.last_alive[csessid] = (time.time(), False)
return '""' | cwe-079 | {'deleted': [{'line_no': 6, 'char_start': 155, 'char_end': 204, 'line': " csessid = request.args.get('csessid')[0]\n"}], 'added': [{'line_no': 6, 'char_start': 155, 'char_end': 212, 'line': " csessid = cgi.escape(request.args['csessid'][0])\n"}]} | {'deleted': [{'char_start': 185, 'char_end': 190, 'chars': '.get('}, {'char_start': 199, 'char_end': 200, 'chars': ')'}], 'added': [{'char_start': 173, 'char_end': 184, 'chars': 'cgi.escape('}, {'char_start': 196, 'char_end': 197, 'chars': '['}, {'char_start': 206, 'char_end': 207, 'chars': ']'}, {'char_start': 210, 'c... | true | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
mode_keepalive | def mode_keepalive(self, request):
"""
This is called by render_POST when the
client is replying to the keepalive.
"""
csessid = cgi.escape(request.args['csessid'][0])
self.last_alive[csessid] = (time.time(), False)
return '""' | cwe-079 | {'deleted': [{'line_no': 6, 'char_start': 155, 'char_end': 204, 'line': " csessid = request.args.get('csessid')[0]\n"}], 'added': [{'line_no': 6, 'char_start': 155, 'char_end': 212, 'line': " csessid = cgi.escape(request.args['csessid'][0])\n"}]} | {'deleted': [{'char_start': 185, 'char_end': 190, 'chars': '.get('}, {'char_start': 199, 'char_end': 200, 'chars': ')'}], 'added': [{'char_start': 173, 'char_end': 184, 'chars': 'cgi.escape('}, {'char_start': 196, 'char_end': 197, 'chars': '['}, {'char_start': 206, 'char_end': 207, 'chars': ']'}, {'char_start': 210, 'c... | false | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
subscribe_for_tags | @csrf.csrf_protect
def subscribe_for_tags(request):
"""process subscription of users by tags"""
#todo - use special separator to split tags
tag_names = request.REQUEST.get('tags','').strip().split()
pure_tag_names, wildcards = forms.clean_marked_tagnames(tag_names)
if request.user.is_authenticated()... | cwe-079 | {'deleted': [{'line_no': 22, 'char_start': 905, 'char_end': 984, 'line': " ) % {'url': request.path + '?tags=' + request.REQUEST['tags']}\n"}], 'added': [{'line_no': 22, 'char_start': 905, 'char_end': 992, 'line': " ) % {'url': escape(request.path) + '?tags=' + request.REQUEST['tags']}\n"}... | {'deleted': [], 'added': [{'char_start': 933, 'char_end': 940, 'chars': 'escape('}, {'char_start': 952, 'char_end': 953, 'chars': ')'}]} | true | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
subscribe_for_tags | @csrf.csrf_protect
def subscribe_for_tags(request):
"""process subscription of users by tags"""
#todo - use special separator to split tags
tag_names = request.REQUEST.get('tags','').strip().split()
pure_tag_names, wildcards = forms.clean_marked_tagnames(tag_names)
if request.user.is_authenticated()... | cwe-079 | {'deleted': [{'line_no': 22, 'char_start': 905, 'char_end': 984, 'line': " ) % {'url': request.path + '?tags=' + request.REQUEST['tags']}\n"}], 'added': [{'line_no': 22, 'char_start': 905, 'char_end': 992, 'line': " ) % {'url': escape(request.path) + '?tags=' + request.REQUEST['tags']}\n"}... | {'deleted': [], 'added': [{'char_start': 933, 'char_end': 940, 'chars': 'escape('}, {'char_start': 952, 'char_end': 953, 'chars': ')'}]} | false | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
nav_path | def nav_path(request):
"""Return current path as list of items with "name" and "href" members
The href members are view_directory links for directories and view_log
links for files, but are set to None when the link would point to
the current view"""
if not request.repos:
return []
is_dir = request.p... | cwe-079 | {'deleted': [{'line_no': 28, 'char_start': 897, 'char_end': 936, 'line': ' item = _item(name=part, href=None)\n'}], 'added': [{'line_no': 28, 'char_start': 897, 'char_end': 959, 'line': ' item = _item(name=request.server.escape(part), href=None)\n'}]} | {'deleted': [], 'added': [{'char_start': 919, 'char_end': 941, 'chars': 'request.server.escape('}, {'char_start': 945, 'char_end': 946, 'chars': ')'}]} | true | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
nav_path | def nav_path(request):
"""Return current path as list of items with "name" and "href" members
The href members are view_directory links for directories and view_log
links for files, but are set to None when the link would point to
the current view"""
if not request.repos:
return []
is_dir = request.p... | cwe-079 | {'deleted': [{'line_no': 28, 'char_start': 897, 'char_end': 936, 'line': ' item = _item(name=part, href=None)\n'}], 'added': [{'line_no': 28, 'char_start': 897, 'char_end': 959, 'line': ' item = _item(name=request.server.escape(part), href=None)\n'}]} | {'deleted': [], 'added': [{'char_start': 919, 'char_end': 941, 'chars': 'request.server.escape('}, {'char_start': 945, 'char_end': 946, 'chars': ')'}]} | false | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
__init__ | def __init__(self, *args, **kwargs):
"""
Takes two additional keyword arguments:
:param cartpos: The cart position the form should be for
:param event: The event this belongs to
"""
cartpos = self.cartpos = kwargs.pop('cartpos', None)
orderpos = self.orderpos... | cwe-079 | {'deleted': [{'line_no': 55, 'char_start': 2264, 'char_end': 2323, 'line': ' label=q.question, required=q.required,\n'}, {'line_no': 61, 'char_start': 2531, 'char_end': 2590, 'line': ' label=q.question, required=q.required,\n'}, {'line_no': 68, 'char_start': 2853, 'char_end': 2912,... | {'deleted': [{'char_start': 1759, 'char_end': 1759, 'chars': ''}, {'char_start': 2290, 'char_end': 2294, 'chars': 'q.qu'}, {'char_start': 2295, 'char_end': 2300, 'chars': 'stion'}, {'char_start': 2557, 'char_end': 2561, 'chars': 'q.qu'}, {'char_start': 2562, 'char_end': 2567, 'chars': 'stion'}, {'char_start': 2879, 'ch... | true | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
__init__ | def __init__(self, *args, **kwargs):
"""
Takes two additional keyword arguments:
:param cartpos: The cart position the form should be for
:param event: The event this belongs to
"""
cartpos = self.cartpos = kwargs.pop('cartpos', None)
orderpos = self.orderpos... | cwe-079 | {'deleted': [{'line_no': 55, 'char_start': 2264, 'char_end': 2323, 'line': ' label=q.question, required=q.required,\n'}, {'line_no': 61, 'char_start': 2531, 'char_end': 2590, 'line': ' label=q.question, required=q.required,\n'}, {'line_no': 68, 'char_start': 2853, 'char_end': 2912,... | {'deleted': [{'char_start': 1759, 'char_end': 1759, 'chars': ''}, {'char_start': 2290, 'char_end': 2294, 'chars': 'q.qu'}, {'char_start': 2295, 'char_end': 2300, 'chars': 'stion'}, {'char_start': 2557, 'char_end': 2561, 'chars': 'q.qu'}, {'char_start': 2562, 'char_end': 2567, 'chars': 'stion'}, {'char_start': 2879, 'ch... | false | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
link_dialog | def link_dialog(request):
# list of wiki pages
name = request.values.get("pagename", "")
if name:
from MoinMoin import search
# XXX error handling!
searchresult = search.searchPages(request, 't:"%s"' % name)
pages = [p.page_name for p in searchresult.hits]
pages.sort... | cwe-079 | {'deleted': [{'line_no': 100, 'char_start': 3711, 'char_end': 3789, 'line': ' <input id="txtPagename" name="pagename" size="30" value="%(name)s">\n'}], 'added': [{'line_no': 4, 'char_start': 97, 'char_end': 138, 'line': ' name_escaped = wikiutil.escape(name)\n'}, {'line_no': 101, 'char_start': 3752, 'char_e... | {'deleted': [], 'added': [{'char_start': 101, 'char_end': 142, 'chars': 'name_escaped = wikiutil.escape(name)\n '}, {'char_start': 3825, 'char_end': 3833, 'chars': '_escaped'}]} | true | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
link_dialog | def link_dialog(request):
# list of wiki pages
name = request.values.get("pagename", "")
name_escaped = wikiutil.escape(name)
if name:
from MoinMoin import search
# XXX error handling!
searchresult = search.searchPages(request, 't:"%s"' % name)
pages = [p.page_name for p... | cwe-079 | {'deleted': [{'line_no': 100, 'char_start': 3711, 'char_end': 3789, 'line': ' <input id="txtPagename" name="pagename" size="30" value="%(name)s">\n'}], 'added': [{'line_no': 4, 'char_start': 97, 'char_end': 138, 'line': ' name_escaped = wikiutil.escape(name)\n'}, {'line_no': 101, 'char_start': 3752, 'char_e... | {'deleted': [], 'added': [{'char_start': 101, 'char_end': 142, 'chars': 'name_escaped = wikiutil.escape(name)\n '}, {'char_start': 3825, 'char_end': 3833, 'chars': '_escaped'}]} | false | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
action_save_user | def action_save_user(request: HttpRequest, default_forward_url: str = "/admin/users"):
"""
This functions saves the changes to the user or adds a new one. It completely creates the HttpResponse
:param request: the HttpRequest
:param default_forward_url: The URL to forward to if nothing was specified
... | cwe-079 | {'deleted': [{'line_no': 27, 'char_start': 1188, 'char_end': 1231, 'line': ' user.displayName = displayname\n'}, {'line_no': 29, 'char_start': 1260, 'char_end': 1291, 'line': ' user.notes = notes\n'}, {'line_no': 40, 'char_start': 1855, 'char_end': 1883, 'line': ' au.email = mail\n'}, {... | {'deleted': [], 'added': [{'char_start': 1219, 'char_end': 1226, 'chars': 'escape('}, {'char_start': 1237, 'char_end': 1238, 'chars': ')'}, {'char_start': 1293, 'char_end': 1300, 'chars': 'escape('}, {'char_start': 1305, 'char_end': 1306, 'chars': ')'}, {'char_start': 1894, 'char_end': 1901, 'chars': 'escape('}, {'char... | true | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
action_save_user | def action_save_user(request: HttpRequest, default_forward_url: str = "/admin/users"):
"""
This functions saves the changes to the user or adds a new one. It completely creates the HttpResponse
:param request: the HttpRequest
:param default_forward_url: The URL to forward to if nothing was specified
... | cwe-079 | {'deleted': [{'line_no': 27, 'char_start': 1188, 'char_end': 1231, 'line': ' user.displayName = displayname\n'}, {'line_no': 29, 'char_start': 1260, 'char_end': 1291, 'line': ' user.notes = notes\n'}, {'line_no': 40, 'char_start': 1855, 'char_end': 1883, 'line': ' au.email = mail\n'}, {... | {'deleted': [], 'added': [{'char_start': 1219, 'char_end': 1226, 'chars': 'escape('}, {'char_start': 1237, 'char_end': 1238, 'chars': ')'}, {'char_start': 1293, 'char_end': 1300, 'chars': 'escape('}, {'char_start': 1305, 'char_end': 1306, 'chars': ')'}, {'char_start': 1894, 'char_end': 1901, 'chars': 'escape('}, {'char... | false | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
save | def save(self):
# copy the user's input from plain text to description to be processed
self.description = self.description_plain_text
if CE.settings.auto_cross_reference:
self.auto_cross_ref()
else:
self.find_tag()
self.slug = slugify(self.title)
... | cwe-079 | {'deleted': [{'line_no': 3, 'char_start': 99, 'char_end': 154, 'line': ' self.description = self.description_plain_text\n'}], 'added': [{'line_no': 4, 'char_start': 161, 'char_end': 235, 'line': ' self.description = bleach.clean(str(self.description_plain_text),\n'}, {'line_no': 5, 'char_start': 235, 'cha... | {'deleted': [], 'added': [{'char_start': 107, 'char_end': 169, 'chars': '# uses bleach to remove potentially harmful HTML code\n '}, {'char_start': 188, 'char_end': 205, 'chars': 'bleach.clean(str('}, {'char_start': 232, 'char_end': 359, 'chars': '),\n tags=CE.settings.blea... | true | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
save | def save(self):
# copy the user's input from plain text to description to be processed
# uses bleach to remove potentially harmful HTML code
self.description = bleach.clean(str(self.description_plain_text),
tags=CE.settings.bleach_allowed,
... | cwe-079 | {'deleted': [{'line_no': 3, 'char_start': 99, 'char_end': 154, 'line': ' self.description = self.description_plain_text\n'}], 'added': [{'line_no': 4, 'char_start': 161, 'char_end': 235, 'line': ' self.description = bleach.clean(str(self.description_plain_text),\n'}, {'line_no': 5, 'char_start': 235, 'cha... | {'deleted': [], 'added': [{'char_start': 107, 'char_end': 169, 'chars': '# uses bleach to remove potentially harmful HTML code\n '}, {'char_start': 188, 'char_end': 205, 'chars': 'bleach.clean(str('}, {'char_start': 232, 'char_end': 359, 'chars': '),\n tags=CE.settings.blea... | false | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
mode_close | def mode_close(self, request):
"""
This is called by render_POST when the client is signalling
that it is about to be closed.
Args:
request (Request): Incoming request.
"""
csessid = request.args.get('csessid')[0]
try:
sess = self.ses... | cwe-079 | {'deleted': [{'line_no': 10, 'char_start': 231, 'char_end': 280, 'line': " csessid = request.args.get('csessid')[0]\n"}], 'added': [{'line_no': 10, 'char_start': 231, 'char_end': 288, 'line': " csessid = cgi.escape(request.args['csessid'][0])\n"}]} | {'deleted': [{'char_start': 261, 'char_end': 266, 'chars': '.get('}, {'char_start': 275, 'char_end': 276, 'chars': ')'}], 'added': [{'char_start': 249, 'char_end': 260, 'chars': 'cgi.escape('}, {'char_start': 272, 'char_end': 273, 'chars': '['}, {'char_start': 282, 'char_end': 283, 'chars': ']'}, {'char_start': 286, 'c... | true | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
mode_close | def mode_close(self, request):
"""
This is called by render_POST when the client is signalling
that it is about to be closed.
Args:
request (Request): Incoming request.
"""
csessid = cgi.escape(request.args['csessid'][0])
try:
sess = ... | cwe-079 | {'deleted': [{'line_no': 10, 'char_start': 231, 'char_end': 280, 'line': " csessid = request.args.get('csessid')[0]\n"}], 'added': [{'line_no': 10, 'char_start': 231, 'char_end': 288, 'line': " csessid = cgi.escape(request.args['csessid'][0])\n"}]} | {'deleted': [{'char_start': 261, 'char_end': 266, 'chars': '.get('}, {'char_start': 275, 'char_end': 276, 'chars': ')'}], 'added': [{'char_start': 249, 'char_end': 260, 'chars': 'cgi.escape('}, {'char_start': 272, 'char_end': 273, 'chars': '['}, {'char_start': 282, 'char_end': 283, 'chars': ']'}, {'char_start': 286, 'c... | false | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
get_queryset | def get_queryset(self, **kwargs):
queryset = Article.objects.order_by('-time')
for i in queryset:
i.md = markdown(i.content, extensions=[
'markdown.extensions.extra',
'markdown.extensions.codehilite',
'markdown.extensions.toc',
... | cwe-079 | {'deleted': [{'line_no': 4, 'char_start': 118, 'char_end': 170, 'line': ' i.md = markdown(i.content, extensions=[\n'}, {'line_no': 5, 'char_start': 170, 'char_end': 215, 'line': " 'markdown.extensions.extra',\n"}, {'line_no': 6, 'char_start': 215, 'char_end': 265, 'line': " 'mar... | {'deleted': [{'char_start': 137, 'char_end': 162, 'chars': 'markdown(i.content, exten'}, {'char_start': 163, 'char_end': 188, 'chars': "ions=[\n 'm"}, {'char_start': 189, 'char_end': 196, 'chars': 'rkdown.'}, {'char_start': 197, 'char_end': 232, 'chars': "xtensions.extra',\n '"}, {'char_st... | true | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
get_queryset | def get_queryset(self, **kwargs):
queryset = Article.objects.order_by('-time')
for i in queryset:
i.md = safe_md(i.content)
return queryset | cwe-079 | {'deleted': [{'line_no': 4, 'char_start': 118, 'char_end': 170, 'line': ' i.md = markdown(i.content, extensions=[\n'}, {'line_no': 5, 'char_start': 170, 'char_end': 215, 'line': " 'markdown.extensions.extra',\n"}, {'line_no': 6, 'char_start': 215, 'char_end': 265, 'line': " 'mar... | {'deleted': [{'char_start': 137, 'char_end': 162, 'chars': 'markdown(i.content, exten'}, {'char_start': 163, 'char_end': 188, 'chars': "ions=[\n 'm"}, {'char_start': 189, 'char_end': 196, 'chars': 'rkdown.'}, {'char_start': 197, 'char_end': 232, 'chars': "xtensions.extra',\n '"}, {'char_st... | false | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
screenshotcommentcounts | @register.tag
@basictag(takes_context=True)
def screenshotcommentcounts(context, screenshot):
"""
Returns a JSON array of current comments for a screenshot.
Each entry in the array has a dictionary containing the following keys:
=========== ==================================================
Ke... | cwe-079 | {'deleted': [{'line_no': 32, 'char_start': 1249, 'char_end': 1287, 'line': " 'text': comment.text,\n"}], 'added': [{'line_no': 32, 'char_start': 1249, 'char_end': 1295, 'line': " 'text': escape(comment.text),\n"}]} | {'deleted': [], 'added': [{'char_start': 1273, 'char_end': 1280, 'chars': 'escape('}, {'char_start': 1292, 'char_end': 1293, 'chars': ')'}]} | true | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
screenshotcommentcounts | @register.tag
@basictag(takes_context=True)
def screenshotcommentcounts(context, screenshot):
"""
Returns a JSON array of current comments for a screenshot.
Each entry in the array has a dictionary containing the following keys:
=========== ==================================================
Ke... | cwe-079 | {'deleted': [{'line_no': 32, 'char_start': 1249, 'char_end': 1287, 'line': " 'text': comment.text,\n"}], 'added': [{'line_no': 32, 'char_start': 1249, 'char_end': 1295, 'line': " 'text': escape(comment.text),\n"}]} | {'deleted': [], 'added': [{'char_start': 1273, 'char_end': 1280, 'chars': 'escape('}, {'char_start': 1292, 'char_end': 1293, 'chars': ')'}]} | false | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
mode_input | def mode_input(self, request):
"""
This is called by render_POST when the client
is sending data to the server.
Args:
request (Request): Incoming request.
"""
csessid = request.args.get('csessid')[0]
self.last_alive[csessid] = (time.time(), Fals... | cwe-079 | {'deleted': [{'line_no': 10, 'char_start': 217, 'char_end': 266, 'line': " csessid = request.args.get('csessid')[0]\n"}, {'line_no': 11, 'char_start': 266, 'char_end': 267, 'line': '\n'}, {'line_no': 16, 'char_start': 433, 'char_end': 496, 'line': " cmdarray = json.loads(request.args.get('data')[0])\n... | {'deleted': [{'char_start': 247, 'char_end': 252, 'chars': '.get('}, {'char_start': 261, 'char_end': 262, 'chars': ')'}, {'char_start': 265, 'char_end': 266, 'chars': '\n'}], 'added': [{'char_start': 235, 'char_end': 246, 'chars': 'cgi.escape('}, {'char_start': 258, 'char_end': 259, 'chars': '['}, {'char_start': 268, '... | true | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
mode_input | def mode_input(self, request):
"""
This is called by render_POST when the client
is sending data to the server.
Args:
request (Request): Incoming request.
"""
csessid = cgi.escape(request.args['csessid'][0])
self.last_alive[csessid] = (time.time(... | cwe-079 | {'deleted': [{'line_no': 10, 'char_start': 217, 'char_end': 266, 'line': " csessid = request.args.get('csessid')[0]\n"}, {'line_no': 11, 'char_start': 266, 'char_end': 267, 'line': '\n'}, {'line_no': 16, 'char_start': 433, 'char_end': 496, 'line': " cmdarray = json.loads(request.args.get('data')[0])\n... | {'deleted': [{'char_start': 247, 'char_end': 252, 'chars': '.get('}, {'char_start': 261, 'char_end': 262, 'chars': ')'}, {'char_start': 265, 'char_end': 266, 'chars': '\n'}], 'added': [{'char_start': 235, 'char_end': 246, 'chars': 'cgi.escape('}, {'char_start': 258, 'char_end': 259, 'chars': '['}, {'char_start': 268, '... | false | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
get_list_context | def get_list_context(context=None):
list_context = frappe._dict(
template = "templates/includes/blog/blog.html",
get_list = get_blog_list,
hide_filters = True,
children = get_children(),
# show_search = True,
title = _('Blog')
)
category = frappe.local.form_dict.blog_category or frappe.local.form_dict.c... | cwe-079 | {'deleted': [{'line_no': 11, 'char_start': 244, 'char_end': 328, 'line': '\tcategory = frappe.local.form_dict.blog_category or frappe.local.form_dict.category\n'}, {'line_no': 23, 'char_start': 768, 'char_end': 853, 'line': '\t\tlist_context.sub_title = _(\'Filtered by "{0}"\').format(frappe.local.form_dict.txt)\n'}], ... | {'deleted': [], 'added': [{'char_start': 256, 'char_end': 270, 'chars': 'sanitize_html('}, {'char_start': 341, 'char_end': 342, 'chars': ')'}, {'char_start': 840, 'char_end': 854, 'chars': 'sanitize_html('}, {'char_start': 880, 'char_end': 881, 'chars': ')'}]} | true | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
get_list_context | def get_list_context(context=None):
list_context = frappe._dict(
template = "templates/includes/blog/blog.html",
get_list = get_blog_list,
hide_filters = True,
children = get_children(),
# show_search = True,
title = _('Blog')
)
category = sanitize_html(frappe.local.form_dict.blog_category or frappe.loc... | cwe-079 | {'deleted': [{'line_no': 11, 'char_start': 244, 'char_end': 328, 'line': '\tcategory = frappe.local.form_dict.blog_category or frappe.local.form_dict.category\n'}, {'line_no': 23, 'char_start': 768, 'char_end': 853, 'line': '\t\tlist_context.sub_title = _(\'Filtered by "{0}"\').format(frappe.local.form_dict.txt)\n'}], ... | {'deleted': [], 'added': [{'char_start': 256, 'char_end': 270, 'chars': 'sanitize_html('}, {'char_start': 341, 'char_end': 342, 'chars': ')'}, {'char_start': 840, 'char_end': 854, 'chars': 'sanitize_html('}, {'char_start': 880, 'char_end': 881, 'chars': ')'}]} | false | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
mode_init | def mode_init(self, request):
"""
This is called by render_POST when the client requests an init
mode operation (at startup)
Args:
request (Request): Incoming request.
"""
csessid = request.args.get('csessid')[0]
remote_addr = request.getClientI... | cwe-079 | {'deleted': [{'line_no': 10, 'char_start': 230, 'char_end': 279, 'line': " csessid = request.args.get('csessid')[0]\n"}], 'added': [{'line_no': 10, 'char_start': 230, 'char_end': 287, 'line': " csessid = cgi.escape(request.args['csessid'][0])\n"}]} | {'deleted': [{'char_start': 260, 'char_end': 265, 'chars': '.get('}, {'char_start': 274, 'char_end': 275, 'chars': ')'}], 'added': [{'char_start': 248, 'char_end': 259, 'chars': 'cgi.escape('}, {'char_start': 271, 'char_end': 272, 'chars': '['}, {'char_start': 281, 'char_end': 282, 'chars': ']'}, {'char_start': 285, 'c... | true | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
mode_init | def mode_init(self, request):
"""
This is called by render_POST when the client requests an init
mode operation (at startup)
Args:
request (Request): Incoming request.
"""
csessid = cgi.escape(request.args['csessid'][0])
remote_addr = request.ge... | cwe-079 | {'deleted': [{'line_no': 10, 'char_start': 230, 'char_end': 279, 'line': " csessid = request.args.get('csessid')[0]\n"}], 'added': [{'line_no': 10, 'char_start': 230, 'char_end': 287, 'line': " csessid = cgi.escape(request.args['csessid'][0])\n"}]} | {'deleted': [{'char_start': 260, 'char_end': 265, 'chars': '.get('}, {'char_start': 274, 'char_end': 275, 'chars': ')'}], 'added': [{'char_start': 248, 'char_end': 259, 'chars': 'cgi.escape('}, {'char_start': 271, 'char_end': 272, 'chars': '['}, {'char_start': 281, 'char_end': 282, 'chars': ']'}, {'char_start': 285, 'c... | false | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
handle_file | def handle_file(u: Profile, headline: str, category: str, text: str, file):
m: Media = Media()
upload_base_path: str = 'uploads/' + str(date.today().year)
high_res_file_name = upload_base_path + '/HIGHRES_' + ntpath.basename(file.name.replace(" ", "_"))
low_res_file_name = upload_base_path + '/LOWRES_' ... | cwe-079 | {'deleted': [{'line_no': 21, 'char_start': 1021, 'char_end': 1039, 'line': ' m.text = text\n'}, {'line_no': 22, 'char_start': 1039, 'char_end': 1081, 'line': ' m.cachedText = compile_markdown(text)\n'}, {'line_no': 23, 'char_start': 1081, 'char_end': 1107, 'line': ' m.category = category\n'}, {'line_no': 26, '... | {'deleted': [], 'added': [{'char_start': 1034, 'char_end': 1041, 'chars': 'escape('}, {'char_start': 1045, 'char_end': 1046, 'chars': ')'}, {'char_start': 1083, 'char_end': 1090, 'chars': 'escape('}, {'char_start': 1094, 'char_end': 1095, 'chars': ')'}, {'char_start': 1114, 'char_end': 1121, 'chars': 'escape('}, {'char... | true | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
handle_file | def handle_file(u: Profile, headline: str, category: str, text: str, file):
m: Media = Media()
upload_base_path: str = 'uploads/' + str(date.today().year)
high_res_file_name = upload_base_path + '/HIGHRES_' + ntpath.basename(file.name.replace(" ", "_"))
low_res_file_name = upload_base_path + '/LOWRES_' ... | cwe-079 | {'deleted': [{'line_no': 21, 'char_start': 1021, 'char_end': 1039, 'line': ' m.text = text\n'}, {'line_no': 22, 'char_start': 1039, 'char_end': 1081, 'line': ' m.cachedText = compile_markdown(text)\n'}, {'line_no': 23, 'char_start': 1081, 'char_end': 1107, 'line': ' m.category = category\n'}, {'line_no': 26, '... | {'deleted': [], 'added': [{'char_start': 1034, 'char_end': 1041, 'chars': 'escape('}, {'char_start': 1045, 'char_end': 1046, 'chars': ')'}, {'char_start': 1083, 'char_end': 1090, 'chars': 'escape('}, {'char_start': 1094, 'char_end': 1095, 'chars': ')'}, {'char_start': 1114, 'char_end': 1121, 'chars': 'escape('}, {'char... | false | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
commentcounts | @register.tag
@basictag(takes_context=True)
def commentcounts(context, filediff, interfilediff=None):
"""
Returns a JSON array of current comments for a filediff, sorted by
line number.
Each entry in the array has a dictionary containing the following keys:
=========== ==========================... | cwe-079 | {'deleted': [{'line_no': 41, 'char_start': 1548, 'char_end': 1586, 'line': " 'text': comment.text,\n"}], 'added': [{'line_no': 41, 'char_start': 1548, 'char_end': 1594, 'line': " 'text': escape(comment.text),\n"}]} | {'deleted': [], 'added': [{'char_start': 1572, 'char_end': 1579, 'chars': 'escape('}, {'char_start': 1591, 'char_end': 1592, 'chars': ')'}]} | true | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
commentcounts | @register.tag
@basictag(takes_context=True)
def commentcounts(context, filediff, interfilediff=None):
"""
Returns a JSON array of current comments for a filediff, sorted by
line number.
Each entry in the array has a dictionary containing the following keys:
=========== ==========================... | cwe-079 | {'deleted': [{'line_no': 41, 'char_start': 1548, 'char_end': 1586, 'line': " 'text': comment.text,\n"}], 'added': [{'line_no': 41, 'char_start': 1548, 'char_end': 1594, 'line': " 'text': escape(comment.text),\n"}]} | {'deleted': [], 'added': [{'char_start': 1572, 'char_end': 1579, 'chars': 'escape('}, {'char_start': 1591, 'char_end': 1592, 'chars': ')'}]} | false | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
get | @handler.unsupported_on_local_server
@handler.get(handler.HTML)
def get(self):
"""Handle a get request."""
self.render(
'login.html', {
'apiKey': local_config.ProjectConfig().get('firebase.api_key'),
'authDomain': auth.auth_domain(),
'dest': self.request.get('de... | cwe-079 | {'deleted': [{'line_no': 9, 'char_start': 280, 'char_end': 326, 'line': " 'dest': self.request.get('dest'),\n"}], 'added': [{'line_no': 5, 'char_start': 117, 'char_end': 153, 'line': " dest = self.request.get('dest')\n"}, {'line_no': 6, 'char_start': 153, 'char_end': 195, 'line': ' base_handler.check_r... | {'deleted': [{'char_start': 300, 'char_end': 318, 'chars': "self.request.get('"}, {'char_start': 322, 'char_end': 324, 'chars': "')"}], 'added': [{'char_start': 121, 'char_end': 200, 'chars': "dest = self.request.get('dest')\n base_handler.check_redirect_url(dest)\n\n "}]} | true | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
get | @handler.unsupported_on_local_server
@handler.get(handler.HTML)
def get(self):
"""Handle a get request."""
dest = self.request.get('dest')
base_handler.check_redirect_url(dest)
self.render(
'login.html', {
'apiKey': local_config.ProjectConfig().get('firebase.api_key'),
... | cwe-079 | {'deleted': [{'line_no': 9, 'char_start': 280, 'char_end': 326, 'line': " 'dest': self.request.get('dest'),\n"}], 'added': [{'line_no': 5, 'char_start': 117, 'char_end': 153, 'line': " dest = self.request.get('dest')\n"}, {'line_no': 6, 'char_start': 153, 'char_end': 195, 'line': ' base_handler.check_r... | {'deleted': [{'char_start': 300, 'char_end': 318, 'chars': "self.request.get('"}, {'char_start': 322, 'char_end': 324, 'chars': "')"}], 'added': [{'char_start': 121, 'char_end': 200, 'chars': "dest = self.request.get('dest')\n base_handler.check_redirect_url(dest)\n\n "}]} | false | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
manipulate_reservation_action | def manipulate_reservation_action(request: HttpRequest, default_foreward_url: str):
"""
This function is used to alter the reservation beeing build inside
a cookie. This function automatically crafts the required response.
"""
js_string: str = ""
r: GroupReservation = None
u: Profile = get_c... | cwe-079 | {'deleted': [{'line_no': 22, 'char_start': 869, 'char_end': 914, 'line': ' sr.notes = request.POST["notes"]\n'}, {'line_no': 42, 'char_start': 1748, 'char_end': 1788, 'line': ' r.notes = request.POST["notes"]\n'}, {'line_no': 44, 'char_start': 1824, 'char_end': 1883, 'line': ' r.responsiblePers... | {'deleted': [], 'added': [{'char_start': 892, 'char_end': 899, 'chars': 'escape('}, {'char_start': 920, 'char_end': 921, 'chars': ')'}, {'char_start': 1774, 'char_end': 1781, 'chars': 'escape('}, {'char_start': 1802, 'char_end': 1803, 'chars': ')'}, {'char_start': 1870, 'char_end': 1877, 'chars': 'escape('}, {'char_sta... | true | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
manipulate_reservation_action | def manipulate_reservation_action(request: HttpRequest, default_foreward_url: str):
"""
This function is used to alter the reservation beeing build inside
a cookie. This function automatically crafts the required response.
"""
js_string: str = ""
r: GroupReservation = None
u: Profile = get_c... | cwe-079 | {'deleted': [{'line_no': 22, 'char_start': 869, 'char_end': 914, 'line': ' sr.notes = request.POST["notes"]\n'}, {'line_no': 42, 'char_start': 1748, 'char_end': 1788, 'line': ' r.notes = request.POST["notes"]\n'}, {'line_no': 44, 'char_start': 1824, 'char_end': 1883, 'line': ' r.responsiblePers... | {'deleted': [], 'added': [{'char_start': 892, 'char_end': 899, 'chars': 'escape('}, {'char_start': 920, 'char_end': 921, 'chars': ')'}, {'char_start': 1774, 'char_end': 1781, 'chars': 'escape('}, {'char_start': 1802, 'char_end': 1803, 'chars': ')'}, {'char_start': 1870, 'char_end': 1877, 'chars': 'escape('}, {'char_sta... | false | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
html_content | @property
async def html_content(self):
content = await self.content
if not content:
return ''
return markdown(content) | cwe-079 | {'deleted': [{'line_no': 3, 'char_start': 48, 'char_end': 85, 'line': ' content = await self.content\n'}], 'added': [{'line_no': 3, 'char_start': 48, 'char_end': 104, 'line': ' content = markupsafe.escape(await self.content)\n'}]} | {'deleted': [], 'added': [{'char_start': 66, 'char_end': 84, 'chars': 'markupsafe.escape('}, {'char_start': 102, 'char_end': 103, 'chars': ')'}]} | true | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
html_content | @property
async def html_content(self):
content = markupsafe.escape(await self.content)
if not content:
return ''
return markdown(content) | cwe-079 | {'deleted': [{'line_no': 3, 'char_start': 48, 'char_end': 85, 'line': ' content = await self.content\n'}], 'added': [{'line_no': 3, 'char_start': 48, 'char_end': 104, 'line': ' content = markupsafe.escape(await self.content)\n'}]} | {'deleted': [], 'added': [{'char_start': 66, 'char_end': 84, 'chars': 'markupsafe.escape('}, {'char_start': 102, 'char_end': 103, 'chars': ')'}]} | false | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
get_context_data | def get_context_data(self, *args, **kwargs):
data = super().get_context_data(*args, **kwargs)
if self.request.GET.get('back', None) is not None:
data['back_link'] = self.request.GET['back']
return data | cwe-079 | {'deleted': [{'line_no': 4, 'char_start': 107, 'char_end': 166, 'line': " if self.request.GET.get('back', None) is not None:\n"}, {'line_no': 5, 'char_start': 166, 'char_end': 223, 'line': " data['back_link'] = self.request.GET['back']\n"}], 'added': [{'line_no': 4, 'char_start': 107, 'char_end': 157,... | {'deleted': [{'char_start': 115, 'char_end': 117, 'chars': 'if'}, {'char_start': 198, 'char_end': 216, 'chars': "self.request.GET['"}, {'char_start': 220, 'char_end': 222, 'chars': "']"}], 'added': [{'char_start': 115, 'char_end': 121, 'chars': 'back ='}, {'char_start': 156, 'char_end': 307, 'chars': '\n parsed_... | true | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
get_context_data | def get_context_data(self, *args, **kwargs):
data = super().get_context_data(*args, **kwargs)
back = self.request.GET.get('back', None)
parsed_back_url = urllib.parse.urlparse(back)
# We only allow blank scheme, e.g. relative urls to avoid reflected XSS
if back is not None ... | cwe-079 | {'deleted': [{'line_no': 4, 'char_start': 107, 'char_end': 166, 'line': " if self.request.GET.get('back', None) is not None:\n"}, {'line_no': 5, 'char_start': 166, 'char_end': 223, 'line': " data['back_link'] = self.request.GET['back']\n"}], 'added': [{'line_no': 4, 'char_start': 107, 'char_end': 157,... | {'deleted': [{'char_start': 115, 'char_end': 117, 'chars': 'if'}, {'char_start': 198, 'char_end': 216, 'chars': "self.request.GET['"}, {'char_start': 220, 'char_end': 222, 'chars': "']"}], 'added': [{'char_start': 115, 'char_end': 121, 'chars': 'back ='}, {'char_start': 156, 'char_end': 307, 'chars': '\n parsed_... | false | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
add_article_action | def add_article_action(request: HttpRequest, default_foreward_url: str):
forward_url: str = default_foreward_url
if request.GET.get("redirect"):
forward_url = request.GET["redirect"]
else:
forward_url = "/admin"
if "rid" not in request.GET:
return HttpResponseRedirect("/admin?err... | cwe-079 | {'deleted': [{'line_no': 20, 'char_start': 954, 'char_end': 997, 'line': ' notes: str = request.POST["notes"]\n'}, {'line_no': 45, 'char_start': 2195, 'char_end': 2269, 'line': ' ar.notes = str(request.POST[str("notes_" + str(art.id))])\n'}], 'added': [{'line_no': 20, 'char_start': 954, 'char_end'... | {'deleted': [], 'added': [{'char_start': 975, 'char_end': 982, 'chars': 'escape('}, {'char_start': 1003, 'char_end': 1004, 'chars': ')'}, {'char_start': 2230, 'char_end': 2237, 'chars': 'escape('}, {'char_start': 2282, 'char_end': 2283, 'chars': ')'}]} | true | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
add_article_action | def add_article_action(request: HttpRequest, default_foreward_url: str):
forward_url: str = default_foreward_url
if request.GET.get("redirect"):
forward_url = request.GET["redirect"]
else:
forward_url = "/admin"
if "rid" not in request.GET:
return HttpResponseRedirect("/admin?err... | cwe-079 | {'deleted': [{'line_no': 20, 'char_start': 954, 'char_end': 997, 'line': ' notes: str = request.POST["notes"]\n'}, {'line_no': 45, 'char_start': 2195, 'char_end': 2269, 'line': ' ar.notes = str(request.POST[str("notes_" + str(art.id))])\n'}], 'added': [{'line_no': 20, 'char_start': 954, 'char_end'... | {'deleted': [], 'added': [{'char_start': 975, 'char_end': 982, 'chars': 'escape('}, {'char_start': 1003, 'char_end': 1004, 'chars': ')'}, {'char_start': 2230, 'char_end': 2237, 'chars': 'escape('}, {'char_start': 2282, 'char_end': 2283, 'chars': ')'}]} | false | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.