prompt
stringclasses
1 value
completions
listlengths
2
1.33k
labels
listlengths
2
1.33k
source
stringclasses
1 value
other_info
dict
index
int64
0
719
cwe
stringclasses
9 values
language
stringclasses
6 values
Determine whether the {function_name} code is vulnerable or not.
[ "def respond_error(self, context, exception):\n context.respond_server_error()\n stack = traceback.format_exc()\n return \"\"\"\n <html>\n <body>", " <style>\n body {\n font-family: sans-serif;\n ...
[ 1, 1, 1, 1, 0 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 896, "char_start": 885, "chars": "cgi.escape(" }, { "char_end": 902, "char_start": 901, "chars": ")" } ], "deleted": [] }, "commit_link": "github.com/Eugeny/ajenti/commit/d3fc5eb142ff16...
150
cwe-079
py
Determine whether the {function_name} code is vulnerable or not.
[ "def respond_error(self, context, exception):\n context.respond_server_error()\n stack = traceback.format_exc()\n return \"\"\"\n <html>\n <body>", " <style>\n body {\n font-family: sans-serif;\n ...
[ 1, 1, 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 896, "char_start": 885, "chars": "cgi.escape(" }, { "char_end": 902, "char_start": 901, "chars": ")" } ], "deleted": [] }, "commit_link": "github.com/Eugeny/ajenti/commit/d3fc5eb142ff16...
150
cwe-079
py
Determine whether the {function_name} code is vulnerable or not.
[ "@check_document_access_permission()\ndef edit_bundle(request):\n bundle_id = request.GET.get('bundle')\n doc = None\n \n if bundle_id:\n doc = Document2.objects.get(id=bundle_id)\n bundle = Bundle(document=doc)\n else:\n bundle = Bundle()", " coordinators = [dict([('uuid', d.content_object.uuid), ...
[ 1, 1, 1, 0, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 541, "char_start": 530, "chars": "_for_html()" }, { "char_end": 617, "char_start": 593, "chars": ", cls=JSONEncoderForHTML" } ], "deleted": [] }, "commit_link": "github.com/gethue/hue/c...
151
cwe-079
py
Determine whether the {function_name} code is vulnerable or not.
[ "@check_document_access_permission()\ndef edit_bundle(request):\n bundle_id = request.GET.get('bundle')\n doc = None\n \n if bundle_id:\n doc = Document2.objects.get(id=bundle_id)\n bundle = Bundle(document=doc)\n else:\n bundle = Bundle()", " coordinators = [dict([('uuid', d.content_object.uuid), ...
[ 1, 1, 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 541, "char_start": 530, "chars": "_for_html()" }, { "char_end": 617, "char_start": 593, "chars": ", cls=JSONEncoderForHTML" } ], "deleted": [] }, "commit_link": "github.com/gethue/hue/c...
151
cwe-079
py
Determine whether the {function_name} code is vulnerable or not.
[ "def history_data(start_time, offset=None):\n \"\"\"Return history data.", " Arguments:\n start_time: select history starting from this timestamp.\n offset: number of items to skip\n \"\"\"\n # history atimes are stored as ints, ensure start_time is not a float\n start_time = int(star...
[ 1, 1, 0 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 635, "char_start": 623, "chars": "html.escape(" }, { "char_end": 641, "char_start": 640, "chars": ")" }, { "char_end": 655, "char_start": 642, "chars": "\n ...
152
cwe-079
py
Determine whether the {function_name} code is vulnerable or not.
[ "def history_data(start_time, offset=None):\n \"\"\"Return history data.", " Arguments:\n start_time: select history starting from this timestamp.\n offset: number of items to skip\n \"\"\"\n # history atimes are stored as ints, ensure start_time is not a float\n start_time = int(star...
[ 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 635, "char_start": 623, "chars": "html.escape(" }, { "char_end": 641, "char_start": 640, "chars": ")" }, { "char_end": 655, "char_start": 642, "chars": "\n ...
152
cwe-079
py
Determine whether the {function_name} code is vulnerable or not.
[ "@register.filter\ndef json_dumps(value, indent=None):\n if isinstance(value, QuerySet):\n result = serialize('json', value, indent=indent)\n else:\n result = json.dumps(value, indent=indent, cls=DjbletsJSONEncoder)\n", " return mark_safe(result)" ]
[ 1, 0 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 263, "char_start": 252, "chars": "force_text(" }, { "char_end": 299, "char_start": 270, "chars": ".translate(_safe_js_escapes))" } ], "deleted": [] }, "commit_link": "github.com/djblets...
153
cwe-079
py
Determine whether the {function_name} code is vulnerable or not.
[ "@register.filter\ndef json_dumps(value, indent=None):\n if isinstance(value, QuerySet):\n result = serialize('json', value, indent=indent)\n else:\n result = json.dumps(value, indent=indent, cls=DjbletsJSONEncoder)\n", " return mark_safe(force_text(result).translate(_safe_js_escapes))" ]
[ 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 263, "char_start": 252, "chars": "force_text(" }, { "char_end": 299, "char_start": 270, "chars": ".translate(_safe_js_escapes))" } ], "deleted": [] }, "commit_link": "github.com/djblets...
153
cwe-079
py
Determine whether the {function_name} code is vulnerable or not.
[ "def htmlvalue(self, val):", " return self.block.render_basic(val)" ]
[ 1, 0 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 68, "char_start": 38, "chars": "\"\"\"\n Return an HTML rep" }, { "char_end": 73, "char_start": 70, "chars": "sen" }, { "char_end": 117, "char_start": 74, "char...
154
cwe-079
py
Determine whether the {function_name} code is vulnerable or not.
[ "def htmlvalue(self, val):", " \"\"\"\n Return an HTML representation of this block that is safe to be included\n in comparison views\n \"\"\"\n return escape(text_from_html(self.block.render_basic(val)))" ]
[ 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 68, "char_start": 38, "chars": "\"\"\"\n Return an HTML rep" }, { "char_end": 73, "char_start": 70, "chars": "sen" }, { "char_end": 117, "char_start": 74, "char...
154
cwe-079
py
Determine whether the {function_name} code is vulnerable or not.
[ "@register.tag\n@basictag(takes_context=True)\ndef gravatar(context, user, size=None):\n \"\"\"\n Outputs the HTML for displaying a user's gravatar.", " This can take an optional size of the image (defaults to 80 if not\n specified).", " This is also influenced by the following settings:", " ...
[ 1, 1, 1, 1, 1, 1, 0, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 724, "char_start": 713, "chars": "format_html" }, { "char_end": 738, "char_start": 725, "chars": "\n " }, { "char_end": 752, "char_start": 749, "chars": "{0...
155
cwe-079
py
Determine whether the {function_name} code is vulnerable or not.
[ "@register.tag\n@basictag(takes_context=True)\ndef gravatar(context, user, size=None):\n \"\"\"\n Outputs the HTML for displaying a user's gravatar.", " This can take an optional size of the image (defaults to 80 if not\n specified).", " This is also influenced by the following settings:", " ...
[ 1, 1, 1, 1, 1, 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 724, "char_start": 713, "chars": "format_html" }, { "char_end": 738, "char_start": 725, "chars": "\n " }, { "char_end": 752, "char_start": 749, "chars": "{0...
155
cwe-079
py
Determine whether the {function_name} code is vulnerable or not.
[ "QStandardItem* PeerListWidget::addPeer(const QString& ip, BitTorrent::TorrentHandle *const torrent, const BitTorrent::PeerInfo &peer)\n{\n int row = m_listModel->rowCount();\n // Adding Peer to peer list\n m_listModel->insertRow(row);\n m_listModel->setData(m_listModel->index(row, PeerListDelegate::IP)...
[ 1, 0, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 1546, "char_start": 1517, "chars": "Utils::String::toHtmlEscaped(" }, { "char_end": 1559, "char_start": 1558, "chars": ")" } ], "deleted": [] }, "commit_link": "github.com/qbittorrent/q...
156
cwe-079
cpp
Determine whether the {function_name} code is vulnerable or not.
[ "QStandardItem* PeerListWidget::addPeer(const QString& ip, BitTorrent::TorrentHandle *const torrent, const BitTorrent::PeerInfo &peer)\n{\n int row = m_listModel->rowCount();\n // Adding Peer to peer list\n m_listModel->insertRow(row);\n m_listModel->setData(m_listModel->index(row, PeerListDelegate::IP)...
[ 1, 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 1546, "char_start": 1517, "chars": "Utils::String::toHtmlEscaped(" }, { "char_end": 1559, "char_start": 1558, "chars": ")" } ], "deleted": [] }, "commit_link": "github.com/qbittorrent/q...
156
cwe-079
cpp
Determine whether the {function_name} code is vulnerable or not.
[ "def is_safe_url(url, host=None):\n \"\"\"\n Return ``True`` if the url is a safe redirection (i.e. it doesn't point to\n a different host and uses a safe scheme).", " Always returns ``False`` on an empty url.\n \"\"\"\n if url is not None:\n url = url.strip()\n if not url:\n re...
[ 1, 1, 0 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 350, "char_start": 349, "chars": "p" }, { "char_end": 360, "char_start": 359, "chars": "i" }, { "char_end": 364, "char_start": 362, "chars": "co" }, { ...
157
cwe-079
py
Determine whether the {function_name} code is vulnerable or not.
[ "def is_safe_url(url, host=None):\n \"\"\"\n Return ``True`` if the url is a safe redirection (i.e. it doesn't point to\n a different host and uses a safe scheme).", " Always returns ``False`` on an empty url.\n \"\"\"\n if url is not None:\n url = url.strip()\n if not url:\n re...
[ 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 350, "char_start": 349, "chars": "p" }, { "char_end": 360, "char_start": 359, "chars": "i" }, { "char_end": 364, "char_start": 362, "chars": "co" }, { ...
157
cwe-079
py
Determine whether the {function_name} code is vulnerable or not.
[ "def get_context_data(self, **kwargs):\n context = super().get_context_data(**kwargs)\n context['comments'] = self.object.comment_set.all().order_by('-time')\n context['form'] = self.get_form()", " context['md'] = markdown(self.object.content,\n extensio...
[ 1, 0, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 240, "char_start": 239, "chars": "s" }, { "char_end": 245, "char_start": 241, "chars": "fe_m" } ], "deleted": [ { "char_end": 240, "char_start": 239, "chars": ...
158
cwe-079
py
Determine whether the {function_name} code is vulnerable or not.
[ "def get_context_data(self, **kwargs):\n context = super().get_context_data(**kwargs)\n context['comments'] = self.object.comment_set.all().order_by('-time')\n context['form'] = self.get_form()", " context['md'] = safe_md(self.object.content)", "\n return context" ]
[ 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 240, "char_start": 239, "chars": "s" }, { "char_end": 245, "char_start": 241, "chars": "fe_m" } ], "deleted": [ { "char_end": 240, "char_start": 239, "chars": ...
158
cwe-079
py
Determine whether the {function_name} code is vulnerable or not.
[ "@check_document_access_permission()\ndef edit_workflow(request):\n workflow_id = request.GET.get('workflow')\n \n if workflow_id:\n wid = {}\n if workflow_id.isdigit():\n wid['id'] = workflow_id\n else:\n wid['uuid'] = workflow_id\n doc = Document2.objects.get(type='oozie-workflow2', **wid...
[ 1, 1, 1, 0, 1, 0, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 822, "char_start": 798, "chars": ", cls=JSONEncoderForHTML" }, { "char_end": 908, "char_start": 884, "chars": ", cls=JSONEncoderForHTML" }, { "char_end": 1002, "char_start": 9...
159
cwe-079
py
Determine whether the {function_name} code is vulnerable or not.
[ "@check_document_access_permission()\ndef edit_workflow(request):\n workflow_id = request.GET.get('workflow')\n \n if workflow_id:\n wid = {}\n if workflow_id.isdigit():\n wid['id'] = workflow_id\n else:\n wid['uuid'] = workflow_id\n doc = Document2.objects.get(type='oozie-workflow2', **wid...
[ 1, 1, 1, 1, 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 822, "char_start": 798, "chars": ", cls=JSONEncoderForHTML" }, { "char_end": 908, "char_start": 884, "chars": ", cls=JSONEncoderForHTML" }, { "char_end": 1002, "char_start": 9...
159
cwe-079
py
Determine whether the {function_name} code is vulnerable or not.
[ "@classmethod\n 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)\n highlighted_fields = [f.split('^', 1)[0] for f in cls.search_fields]", "", "", " es_search =...
[ 1, 0, 1, 0, 1, 0, 1, 0, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 240, "char_start": 84, "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_en...
160
cwe-079
py
Determine whether the {function_name} code is vulnerable or not.
[ "@classmethod\n def simple_search(cls, query, using=None, index=None):", " \"\"\"\n Do a search without facets.", " This is used in:", " * The Docsearch API\n * The Project Admin Search page\n \"\"\"\n", " es_search = cls.search(using=using, index=index)",...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 240, "char_start": 84, "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_en...
160
cwe-079
py
Determine whether the {function_name} code is vulnerable or not.
[ "bool WddxPacket::recursiveAddVar(const String& varName,\n const Variant& varVariant,\n bool hasVarTag) {", " bool isArray = varVariant.isArray();\n bool isObject = varVariant.isObject();", " if (isArray || isObject) {\n if (hasVarTag) {\n ...
[ 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 2094, "char_start": 2094, "chars": "" }, { "char_end": 2421, "char_start": 2195, "chars": ";\n } else {\n varValue = StringUtil::HtmlEncode(varVariant.toString(),\n ...
161
cwe-079
cpp
Determine whether the {function_name} code is vulnerable or not.
[ "bool WddxPacket::recursiveAddVar(const String& varName,\n const Variant& varVariant,\n bool hasVarTag) {", " bool isArray = varVariant.isArray();\n bool isObject = varVariant.isObject();", " if (isArray || isObject) {\n if (hasVarTag) {\n ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 2094, "char_start": 2094, "chars": "" }, { "char_end": 2421, "char_start": 2195, "chars": ";\n } else {\n varValue = StringUtil::HtmlEncode(varVariant.toString(),\n ...
161
cwe-079
cpp
Determine whether the {function_name} code is vulnerable or not.
[ "def mode_receive(self, request):\n \"\"\"\n This is called by render_POST when the client is telling us\n that it is ready to receive data as soon as it is available.\n This is the basis of a long-polling (comet) mechanism: the\n server will wait to reply until data is available....
[ 1, 1, 1, 0, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 418, "char_start": 407, "chars": "cgi.escape(" }, { "char_end": 431, "char_start": 430, "chars": "[" }, { "char_end": 441, "char_start": 440, "chars": "]" }, ...
162
cwe-079
py
Determine whether the {function_name} code is vulnerable or not.
[ "def mode_receive(self, request):\n \"\"\"\n This is called by render_POST when the client is telling us\n that it is ready to receive data as soon as it is available.\n This is the basis of a long-polling (comet) mechanism: the\n server will wait to reply until data is available....
[ 1, 1, 1, 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 418, "char_start": 407, "chars": "cgi.escape(" }, { "char_end": 431, "char_start": 430, "chars": "[" }, { "char_end": 441, "char_start": 440, "chars": "]" }, ...
162
cwe-079
py
Determine whether the {function_name} code is vulnerable or not.
[ "@check_document_access_permission()\ndef edit_coordinator(request):\n coordinator_id = request.GET.get('coordinator')\n doc = None\n \n if coordinator_id:\n doc = Document2.objects.get(id=coordinator_id)\n coordinator = Coordinator(document=doc)\n else:\n coordinator = Coordinator()", " api = get_...
[ 1, 1, 1, 1, 1, 0, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 968, "char_start": 957, "chars": "_for_html()" }, { "char_end": 1061, "char_start": 1037, "chars": ", cls=JSONEncoderForHTML" }, { "char_end": 1132, "char_start": 1108, ...
163
cwe-079
py
Determine whether the {function_name} code is vulnerable or not.
[ "@check_document_access_permission()\ndef edit_coordinator(request):\n coordinator_id = request.GET.get('coordinator')\n doc = None\n \n if coordinator_id:\n doc = Document2.objects.get(id=coordinator_id)\n coordinator = Coordinator(document=doc)\n else:\n coordinator = Coordinator()", " api = get_...
[ 1, 1, 1, 1, 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 968, "char_start": 957, "chars": "_for_html()" }, { "char_end": 1061, "char_start": 1037, "chars": ", cls=JSONEncoderForHTML" }, { "char_end": 1132, "char_start": 1108, ...
163
cwe-079
py
Determine whether the {function_name} code is vulnerable or not.
[ "def _keyify(key):", " return _key_pattern.sub(' ', key.lower())" ]
[ 1, 0 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 64, "char_start": 22, "chars": "key = escape(key.lower(), quote=True)\n " } ], "deleted": [ { "char_end": 62, "char_start": 54, "chars": ".lower()" } ] }, "commit_link": "github....
164
cwe-079
py
Determine whether the {function_name} code is vulnerable or not.
[ "def _keyify(key):", " key = escape(key.lower(), quote=True)\n return _key_pattern.sub(' ', key)" ]
[ 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 64, "char_start": 22, "chars": "key = escape(key.lower(), quote=True)\n " } ], "deleted": [ { "char_end": 62, "char_start": 54, "chars": ".lower()" } ] }, "commit_link": "github....
164
cwe-079
py
Determine whether the {function_name} code is vulnerable or not.
[ "@login_required(redirect_field_name='', login_url='/403')\n@require_POST\n@require_AJAX\n@transaction.atomic\ndef batch_edit_translations(request):\n \"\"\"Perform an action on a list of translations.", " Available actions are defined in `ACTIONS_FN_MAP`. Arguments to this view\n are defined in `models....
[ 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 480, "char_start": 464, "chars": "escape_html=True" } ], "deleted": [] }, "commit_link": "github.com/onefork/pontoon-sr/commit/fc07ed9c68e08d41f74c078b4e7727f1a0888be8", "file_name": "pontoon/batch/views.py", "func_na...
165
cwe-079
py
Determine whether the {function_name} code is vulnerable or not.
[ "@login_required(redirect_field_name='', login_url='/403')\n@require_POST\n@require_AJAX\n@transaction.atomic\ndef batch_edit_translations(request):\n \"\"\"Perform an action on a list of translations.", " Available actions are defined in `ACTIONS_FN_MAP`. Arguments to this view\n are defined in `models....
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 480, "char_start": 464, "chars": "escape_html=True" } ], "deleted": [] }, "commit_link": "github.com/onefork/pontoon-sr/commit/fc07ed9c68e08d41f74c078b4e7727f1a0888be8", "file_name": "pontoon/batch/views.py", "func_na...
165
cwe-079
py
Determine whether the {function_name} code is vulnerable or not.
[ "def make_eb_config(application_name, default_region):\n # Capture our current directory\n UTILS_DIR = os.path.dirname(os.path.abspath(__file__))\n # Create the jinja2 environment.\n # Notice the use of trim_blocks, which greatly helps control whitespace.", " j2_env = Environment(loader=FileSystemL...
[ 1, 0, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 339, "char_start": 322, "chars": ", autoescape=True" } ], "deleted": [] }, "commit_link": "github.com/OkunaOrg/okuna-www-api/commit/8c40c66ea7c483a0cbda4c21940180af909aab99", "file_name": "utils/make_eb_config.py", "f...
166
cwe-079
py
Determine whether the {function_name} code is vulnerable or not.
[ "def make_eb_config(application_name, default_region):\n # Capture our current directory\n UTILS_DIR = os.path.dirname(os.path.abspath(__file__))\n # Create the jinja2 environment.\n # Notice the use of trim_blocks, which greatly helps control whitespace.", " j2_env = Environment(loader=FileSystemL...
[ 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 339, "char_start": 322, "chars": ", autoescape=True" } ], "deleted": [] }, "commit_link": "github.com/OkunaOrg/okuna-www-api/commit/8c40c66ea7c483a0cbda4c21940180af909aab99", "file_name": "utils/make_eb_config.py", "f...
166
cwe-079
py
Determine whether the {function_name} code is vulnerable or not.
[ "def mode_keepalive(self, request):\n \"\"\"\n This is called by render_POST when the\n client is replying to the keepalive.\n \"\"\"", " csessid = request.args.get('csessid')[0]", " self.last_alive[csessid] = (time.time(), False)\n return '\"\"'" ]
[ 1, 0, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 184, "char_start": 173, "chars": "cgi.escape(" }, { "char_end": 197, "char_start": 196, "chars": "[" }, { "char_end": 207, "char_start": 206, "chars": "]" }, ...
167
cwe-079
py
Determine whether the {function_name} code is vulnerable or not.
[ "def mode_keepalive(self, request):\n \"\"\"\n This is called by render_POST when the\n client is replying to the keepalive.\n \"\"\"", " csessid = cgi.escape(request.args['csessid'][0])", " self.last_alive[csessid] = (time.time(), False)\n return '\"\"'" ]
[ 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 184, "char_start": 173, "chars": "cgi.escape(" }, { "char_end": 197, "char_start": 196, "chars": "[" }, { "char_end": 207, "char_start": 206, "chars": "]" }, ...
167
cwe-079
py
Determine whether the {function_name} code is vulnerable or not.
[ "void Logger::addPeer(const QString &ip, bool blocked, const QString &reason)\n{\n QWriteLocker locker(&lock);\n", " Log::Peer temp = { peerCounter++, QDateTime::currentMSecsSinceEpoch(), ip, blocked, reason };", " m_peers.push_back(temp);", " if (m_peers.size() >= MAX_LOG_MESSAGES)\n m_pee...
[ 1, 0, 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 216, "char_start": 187, "chars": "Utils::String::toHtmlEscaped(" }, { "char_end": 219, "char_start": 218, "chars": ")" }, { "char_end": 259, "char_start": 230, "chars"...
168
cwe-079
cpp
Determine whether the {function_name} code is vulnerable or not.
[ "void Logger::addPeer(const QString &ip, bool blocked, const QString &reason)\n{\n QWriteLocker locker(&lock);\n", " Log::Peer temp = { peerCounter++, QDateTime::currentMSecsSinceEpoch(), Utils::String::toHtmlEscaped(ip), blocked, Utils::String::toHtmlEscaped(reason) };", " m_peers.push_back(temp);", ...
[ 1, 1, 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 216, "char_start": 187, "chars": "Utils::String::toHtmlEscaped(" }, { "char_end": 219, "char_start": 218, "chars": ")" }, { "char_end": 259, "char_start": 230, "chars"...
168
cwe-079
cpp
Determine whether the {function_name} code is vulnerable or not.
[ "@csrf.csrf_protect\ndef subscribe_for_tags(request):\n \"\"\"process subscription of users by tags\"\"\"\n #todo - use special separator to split tags\n tag_names = request.REQUEST.get('tags','').strip().split()\n pure_tag_names, wildcards = forms.clean_marked_tagnames(tag_names)\n if request.user.i...
[ 1, 0, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 940, "char_start": 933, "chars": "escape(" }, { "char_end": 953, "char_start": 952, "chars": ")" } ], "deleted": [] }, "commit_link": "github.com/ASKBOT/askbot-devel/commit/a676a86b6b7a...
169
cwe-079
py
Determine whether the {function_name} code is vulnerable or not.
[ "@csrf.csrf_protect\ndef subscribe_for_tags(request):\n \"\"\"process subscription of users by tags\"\"\"\n #todo - use special separator to split tags\n tag_names = request.REQUEST.get('tags','').strip().split()\n pure_tag_names, wildcards = forms.clean_marked_tagnames(tag_names)\n if request.user.i...
[ 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 940, "char_start": 933, "chars": "escape(" }, { "char_end": 953, "char_start": 952, "chars": ")" } ], "deleted": [] }, "commit_link": "github.com/ASKBOT/askbot-devel/commit/a676a86b6b7a...
169
cwe-079
py
Determine whether the {function_name} code is vulnerable or not.
[ "def nav_path(request):\n \"\"\"Return current path as list of items with \"name\" and \"href\" members", " The href members are view_directory links for directories and view_log\n links for files, but are set to None when the link would point to\n the current view\"\"\"", " if not request.repos:\n retu...
[ 1, 1, 1, 1, 1, 1, 0, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 941, "char_start": 919, "chars": "request.server.escape(" }, { "char_end": 946, "char_start": 945, "chars": ")" } ], "deleted": [] }, "commit_link": "github.com/viewvc/viewvc/commit/9dc...
170
cwe-079
py
Determine whether the {function_name} code is vulnerable or not.
[ "def nav_path(request):\n \"\"\"Return current path as list of items with \"name\" and \"href\" members", " The href members are view_directory links for directories and view_log\n links for files, but are set to None when the link would point to\n the current view\"\"\"", " if not request.repos:\n retu...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 941, "char_start": 919, "chars": "request.server.escape(" }, { "char_end": 946, "char_start": 945, "chars": ")" } ], "deleted": [] }, "commit_link": "github.com/viewvc/viewvc/commit/9dc...
170
cwe-079
py
Determine whether the {function_name} code is vulnerable or not.
[ "def __init__(self, *args, **kwargs):\n \"\"\"\n Takes two additional keyword arguments:", " :param cartpos: The cart position the form should be for\n :param event: The event this belongs to\n \"\"\"\n cartpos = self.cartpos = kwargs.pop('cartpos', None)\n orderpo...
[ 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 1799, "char_start": 1723, "chars": "label = escape(q.question) # django-bootstrap3 calls mark_safe\n " }, { "char_end": 2369, "char_start": 2366, "chars": "lab" }, { "char...
171
cwe-079
py
Determine whether the {function_name} code is vulnerable or not.
[ "def __init__(self, *args, **kwargs):\n \"\"\"\n Takes two additional keyword arguments:", " :param cartpos: The cart position the form should be for\n :param event: The event this belongs to\n \"\"\"\n cartpos = self.cartpos = kwargs.pop('cartpos', None)\n orderpo...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 1799, "char_start": 1723, "chars": "label = escape(q.question) # django-bootstrap3 calls mark_safe\n " }, { "char_end": 2369, "char_start": 2366, "chars": "lab" }, { "char...
171
cwe-079
py
Determine whether the {function_name} code is vulnerable or not.
[ "def link_dialog(request):\n # list of wiki pages\n name = request.values.get(\"pagename\", \"\")", "", " if name:\n from MoinMoin import search\n # XXX error handling!\n searchresult = search.searchPages(request, 't:\"%s\"' % name)", " pages = [p.page_name for p in search...
[ 1, 0, 1, 1, 1, 1, 0, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 142, "char_start": 101, "chars": "name_escaped = wikiutil.escape(name)\n " }, { "char_end": 3833, "char_start": 3825, "chars": "_escaped" } ], "deleted": [] }, "commit_link": "github...
172
cwe-079
py
Determine whether the {function_name} code is vulnerable or not.
[ "def link_dialog(request):\n # list of wiki pages\n name = request.values.get(\"pagename\", \"\")", " name_escaped = wikiutil.escape(name)", " if name:\n from MoinMoin import search\n # XXX error handling!\n searchresult = search.searchPages(request, 't:\"%s\"' % name)", " ...
[ 1, 1, 1, 1, 1, 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 142, "char_start": 101, "chars": "name_escaped = wikiutil.escape(name)\n " }, { "char_end": 3833, "char_start": 3825, "chars": "_escaped" } ], "deleted": [] }, "commit_link": "github...
172
cwe-079
py
Determine whether the {function_name} code is vulnerable or not.
[ "def action_save_user(request: HttpRequest, default_forward_url: str = \"/admin/users\"):\n \"\"\"\n This functions saves the changes to the user or adds a new one. It completely creates the HttpResponse\n :param request: the HttpRequest\n :param default_forward_url: The URL to forward to if nothing was...
[ 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 1226, "char_start": 1219, "chars": "escape(" }, { "char_end": 1238, "char_start": 1237, "chars": ")" }, { "char_end": 1300, "char_start": 1293, "chars": "escape(" ...
173
cwe-079
py
Determine whether the {function_name} code is vulnerable or not.
[ "def action_save_user(request: HttpRequest, default_forward_url: str = \"/admin/users\"):\n \"\"\"\n This functions saves the changes to the user or adds a new one. It completely creates the HttpResponse\n :param request: the HttpRequest\n :param default_forward_url: The URL to forward to if nothing was...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 1226, "char_start": 1219, "chars": "escape(" }, { "char_end": 1238, "char_start": 1237, "chars": ")" }, { "char_end": 1300, "char_start": 1293, "chars": "escape(" ...
173
cwe-079
py
Determine whether the {function_name} code is vulnerable or not.
[ "def save(self):\n # 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:\n self.auto_cross_ref()\n else:\n self.find_tag()\n self.slug = slugify(s...
[ 1, 0, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 169, "char_start": 107, "chars": "# uses bleach to remove potentially harmful HTML code\n " }, { "char_end": 205, "char_start": 188, "chars": "bleach.clean(str(" }, { "char_end...
174
cwe-079
py
Determine whether the {function_name} code is vulnerable or not.
[ "def save(self):\n # copy the user's input from plain text to description to be processed", " # uses bleach to remove potentially harmful HTML code\n self.description = bleach.clean(str(self.description_plain_text),\n tags=CE.settings.bleach_allowed,\n ...
[ 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 169, "char_start": 107, "chars": "# uses bleach to remove potentially harmful HTML code\n " }, { "char_end": 205, "char_start": 188, "chars": "bleach.clean(str(" }, { "char_end...
174
cwe-079
py
Determine whether the {function_name} code is vulnerable or not.
[ "void PropertiesWidget::loadTorrentInfos(BitTorrent::TorrentHandle *const torrent)\n{\n clear();\n m_torrent = torrent;\n downloaded_pieces->setTorrent(m_torrent);\n pieces_availability->setTorrent(m_torrent);\n if (!m_torrent) return;", " // Save path\n updateSavePath(m_torrent);\n // Has...
[ 1, 1, 1, 1, 0, 1, 0, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 742, "char_start": 713, "chars": "Utils::String::toHtmlEscaped(" }, { "char_end": 762, "char_start": 761, "chars": ")" }, { "char_end": 881, "char_start": 852, "chars"...
175
cwe-079
cpp
Determine whether the {function_name} code is vulnerable or not.
[ "void PropertiesWidget::loadTorrentInfos(BitTorrent::TorrentHandle *const torrent)\n{\n clear();\n m_torrent = torrent;\n downloaded_pieces->setTorrent(m_torrent);\n pieces_availability->setTorrent(m_torrent);\n if (!m_torrent) return;", " // Save path\n updateSavePath(m_torrent);\n // Has...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 742, "char_start": 713, "chars": "Utils::String::toHtmlEscaped(" }, { "char_end": 762, "char_start": 761, "chars": ")" }, { "char_end": 881, "char_start": 852, "chars"...
175
cwe-079
cpp
Determine whether the {function_name} code is vulnerable or not.
[ "def mode_close(self, request):\n \"\"\"\n This is called by render_POST when the client is signalling\n that it is about to be closed.", " Args:\n request (Request): Incoming request.", " \"\"\"", " csessid = request.args.get('csessid')[0]", " try...
[ 1, 1, 1, 0, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 260, "char_start": 249, "chars": "cgi.escape(" }, { "char_end": 273, "char_start": 272, "chars": "[" }, { "char_end": 283, "char_start": 282, "chars": "]" }, ...
176
cwe-079
py
Determine whether the {function_name} code is vulnerable or not.
[ "def mode_close(self, request):\n \"\"\"\n This is called by render_POST when the client is signalling\n that it is about to be closed.", " Args:\n request (Request): Incoming request.", " \"\"\"", " csessid = cgi.escape(request.args['csessid'][0])", " ...
[ 1, 1, 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 260, "char_start": 249, "chars": "cgi.escape(" }, { "char_end": 273, "char_start": 272, "chars": "[" }, { "char_end": 283, "char_start": 282, "chars": "]" }, ...
176
cwe-079
py
Determine whether the {function_name} code is vulnerable or not.
[ "def get_queryset(self, **kwargs):\n queryset = Article.objects.order_by('-time')\n for i in queryset:", " i.md = markdown(i.content, extensions=[\n 'markdown.extensions.extra',\n 'markdown.extensions.codehilite',\n 'markdown.extensions.toc',\n...
[ 1, 0, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 140, "char_start": 139, "chars": "f" }, { "char_end": 142, "char_start": 141, "chars": "_" }, { "char_end": 145, "char_start": 144, "chars": "(" } ], "de...
177
cwe-079
py
Determine whether the {function_name} code is vulnerable or not.
[ "def get_queryset(self, **kwargs):\n queryset = Article.objects.order_by('-time')\n for i in queryset:", " i.md = safe_md(i.content)", "\n return queryset" ]
[ 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 140, "char_start": 139, "chars": "f" }, { "char_end": 142, "char_start": 141, "chars": "_" }, { "char_end": 145, "char_start": 144, "chars": "(" } ], "de...
177
cwe-079
py
Determine whether the {function_name} code is vulnerable or not.
[ "@register.tag\n@basictag(takes_context=True)\ndef screenshotcommentcounts(context, screenshot):\n \"\"\"\n Returns a JSON array of current comments for a screenshot.", " Each entry in the array has a dictionary containing the following keys:", " =========== =======================================...
[ 1, 1, 1, 1, 1, 1, 0, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 1280, "char_start": 1273, "chars": "escape(" }, { "char_end": 1293, "char_start": 1292, "chars": ")" } ], "deleted": [] }, "commit_link": "github.com/reviewboard/reviewboard/commit/7a0a...
178
cwe-079
py
Determine whether the {function_name} code is vulnerable or not.
[ "@register.tag\n@basictag(takes_context=True)\ndef screenshotcommentcounts(context, screenshot):\n \"\"\"\n Returns a JSON array of current comments for a screenshot.", " Each entry in the array has a dictionary containing the following keys:", " =========== =======================================...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 1280, "char_start": 1273, "chars": "escape(" }, { "char_end": 1293, "char_start": 1292, "chars": ")" } ], "deleted": [] }, "commit_link": "github.com/reviewboard/reviewboard/commit/7a0a...
178
cwe-079
py
Determine whether the {function_name} code is vulnerable or not.
[ "def mode_input(self, request):\n \"\"\"\n This is called by render_POST when the client\n is sending data to the server.", " Args:\n request (Request): Incoming request.", " \"\"\"", " csessid = request.args.get('csessid')[0]\n", " self.last_alive...
[ 1, 1, 1, 0, 1, 0, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 246, "char_start": 235, "chars": "cgi.escape(" }, { "char_end": 259, "char_start": 258, "chars": "[" }, { "char_end": 269, "char_start": 268, "chars": "]" }, ...
179
cwe-079
py
Determine whether the {function_name} code is vulnerable or not.
[ "def mode_input(self, request):\n \"\"\"\n This is called by render_POST when the client\n is sending data to the server.", " Args:\n request (Request): Incoming request.", " \"\"\"", " csessid = cgi.escape(request.args['csessid'][0])", " self.last...
[ 1, 1, 1, 1, 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 246, "char_start": 235, "chars": "cgi.escape(" }, { "char_end": 259, "char_start": 258, "chars": "[" }, { "char_end": 269, "char_start": 268, "chars": "]" }, ...
179
cwe-079
py
Determine whether the {function_name} code is vulnerable or not.
[ "def get_list_context(context=None):\n\tlist_context = frappe._dict(\n\t\ttemplate = \"templates/includes/blog/blog.html\",\n\t\tget_list = get_blog_list,\n\t\thide_filters = True,\n\t\tchildren = get_children(),\n\t\t# show_search = True,\n\t\ttitle = _('Blog')\n\t)\n", "\tcategory = frappe.local.form_dict.blog_...
[ 1, 0, 1, 1, 1, 0, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 270, "char_start": 256, "chars": "sanitize_html(" }, { "char_end": 342, "char_start": 341, "chars": ")" }, { "char_end": 854, "char_start": 840, "chars": "sanitize_htm...
180
cwe-079
py
Determine whether the {function_name} code is vulnerable or not.
[ "def get_list_context(context=None):\n\tlist_context = frappe._dict(\n\t\ttemplate = \"templates/includes/blog/blog.html\",\n\t\tget_list = get_blog_list,\n\t\thide_filters = True,\n\t\tchildren = get_children(),\n\t\t# show_search = True,\n\t\ttitle = _('Blog')\n\t)\n", "\tcategory = sanitize_html(frappe.local.f...
[ 1, 1, 1, 1, 1, 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 270, "char_start": 256, "chars": "sanitize_html(" }, { "char_end": 342, "char_start": 341, "chars": ")" }, { "char_end": 854, "char_start": 840, "chars": "sanitize_htm...
180
cwe-079
py
Determine whether the {function_name} code is vulnerable or not.
[ "def mode_init(self, request):\n \"\"\"\n This is called by render_POST when the client requests an init\n mode operation (at startup)", " Args:\n request (Request): Incoming request.", " \"\"\"", " csessid = request.args.get('csessid')[0]", "\n re...
[ 1, 1, 1, 0, 1, 1, 1, 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 259, "char_start": 248, "chars": "cgi.escape(" }, { "char_end": 272, "char_start": 271, "chars": "[" }, { "char_end": 282, "char_start": 281, "chars": "]" }, ...
181
cwe-079
py
Determine whether the {function_name} code is vulnerable or not.
[ "def mode_init(self, request):\n \"\"\"\n This is called by render_POST when the client requests an init\n mode operation (at startup)", " Args:\n request (Request): Incoming request.", " \"\"\"", " csessid = cgi.escape(request.args['csessid'][0])", "\n ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 259, "char_start": 248, "chars": "cgi.escape(" }, { "char_end": 272, "char_start": 271, "chars": "[" }, { "char_end": 282, "char_start": 281, "chars": "]" }, ...
181
cwe-079
py
Determine whether the {function_name} code is vulnerable or not.
[ "def handle_file(u: Profile, headline: str, category: str, text: str, file):\n m: Media = Media()\n upload_base_path: str = 'uploads/' + str(date.today().year)\n high_res_file_name = upload_base_path + '/HIGHRES_' + ntpath.basename(file.name.replace(\" \", \"_\"))\n low_res_file_name = upload_base_path ...
[ 1, 0, 1, 0, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 1041, "char_start": 1034, "chars": "escape(" }, { "char_end": 1046, "char_start": 1045, "chars": ")" }, { "char_end": 1090, "char_start": 1083, "chars": "escape(" ...
182
cwe-079
py
Determine whether the {function_name} code is vulnerable or not.
[ "def handle_file(u: Profile, headline: str, category: str, text: str, file):\n m: Media = Media()\n upload_base_path: str = 'uploads/' + str(date.today().year)\n high_res_file_name = upload_base_path + '/HIGHRES_' + ntpath.basename(file.name.replace(\" \", \"_\"))\n low_res_file_name = upload_base_path ...
[ 1, 1, 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 1041, "char_start": 1034, "chars": "escape(" }, { "char_end": 1046, "char_start": 1045, "chars": ")" }, { "char_end": 1090, "char_start": 1083, "chars": "escape(" ...
182
cwe-079
py
Determine whether the {function_name} code is vulnerable or not.
[ "@register.tag\n@basictag(takes_context=True)\ndef commentcounts(context, filediff, interfilediff=None):\n \"\"\"\n Returns a JSON array of current comments for a filediff, sorted by\n line number.", " Each entry in the array has a dictionary containing the following keys:", " =========== =====...
[ 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 1579, "char_start": 1572, "chars": "escape(" }, { "char_end": 1592, "char_start": 1591, "chars": ")" } ], "deleted": [] }, "commit_link": "github.com/reviewboard/reviewboard/commit/7a0a...
183
cwe-079
py
Determine whether the {function_name} code is vulnerable or not.
[ "@register.tag\n@basictag(takes_context=True)\ndef commentcounts(context, filediff, interfilediff=None):\n \"\"\"\n Returns a JSON array of current comments for a filediff, sorted by\n line number.", " Each entry in the array has a dictionary containing the following keys:", " =========== =====...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 1579, "char_start": 1572, "chars": "escape(" }, { "char_end": 1592, "char_start": 1591, "chars": ")" } ], "deleted": [] }, "commit_link": "github.com/reviewboard/reviewboard/commit/7a0a...
183
cwe-079
py
Determine whether the {function_name} code is vulnerable or not.
[ "static int oidc_handle_session_management_iframe_rp(request_rec *r, oidc_cfg *c,\n\t\toidc_session_t *session, const char *client_id,\n\t\tconst char *check_session_iframe) {", "\toidc_debug(r, \"enter\");", "\tconst char *java_script =\n\t\t\t\" <script type=\\\"text/javascript\\\">\\n\"\n\t\t\t\" var...
[ 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 797, "char_start": 796, "chars": "d" }, { "char_end": 2291, "char_start": 2275, "chars": "nt poll_interval" }, { "char_end": 2294, "char_start": 2292, "chars": "= " ...
184
cwe-079
c
Determine whether the {function_name} code is vulnerable or not.
[ "static int oidc_handle_session_management_iframe_rp(request_rec *r, oidc_cfg *c,\n\t\toidc_session_t *session, const char *client_id,\n\t\tconst char *check_session_iframe) {", "\toidc_debug(r, \"enter\");", "\tconst char *java_script =\n\t\t\t\" <script type=\\\"text/javascript\\\">\\n\"\n\t\t\t\" var...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 797, "char_start": 796, "chars": "d" }, { "char_end": 2291, "char_start": 2275, "chars": "nt poll_interval" }, { "char_end": 2294, "char_start": 2292, "chars": "= " ...
184
cwe-079
c
Determine whether the {function_name} code is vulnerable or not.
[ "void Logger::addMessage(const QString &message, const Log::MsgType &type)\n{\n QWriteLocker locker(&lock);\n", " Log::Msg temp = { msgCounter++, QDateTime::currentMSecsSinceEpoch(), type, message };", " m_messages.push_back(temp);", " if (m_messages.size() >= MAX_LOG_MESSAGES)\n m_messages...
[ 1, 0, 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 217, "char_start": 188, "chars": "Utils::String::toHtmlEscaped(" }, { "char_end": 225, "char_start": 224, "chars": ")" } ], "deleted": [] }, "commit_link": "github.com/qbittorrent/qBitt...
185
cwe-079
cpp
Determine whether the {function_name} code is vulnerable or not.
[ "void Logger::addMessage(const QString &message, const Log::MsgType &type)\n{\n QWriteLocker locker(&lock);\n", " Log::Msg temp = { msgCounter++, QDateTime::currentMSecsSinceEpoch(), type, Utils::String::toHtmlEscaped(message) };", " m_messages.push_back(temp);", " if (m_messages.size() >= MAX_LOG...
[ 1, 1, 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 217, "char_start": 188, "chars": "Utils::String::toHtmlEscaped(" }, { "char_end": 225, "char_start": 224, "chars": ")" } ], "deleted": [] }, "commit_link": "github.com/qbittorrent/qBitt...
185
cwe-079
cpp
Determine whether the {function_name} code is vulnerable or not.
[ "@handler.unsupported_on_local_server\n @handler.get(handler.HTML)\n def get(self):\n \"\"\"Handle a get request.\"\"\"", "", " self.render(\n 'login.html', {\n 'apiKey': local_config.ProjectConfig().get('firebase.api_key'),\n 'authDomain': auth.auth_domain(),", " ...
[ 1, 0, 1, 0, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 200, "char_start": 121, "chars": "dest = self.request.get('dest')\n base_handler.check_redirect_url(dest)\n\n " } ], "deleted": [ { "char_end": 318, "char_start": 300, "chars": "self.reques...
186
cwe-079
py
Determine whether the {function_name} code is vulnerable or not.
[ "@handler.unsupported_on_local_server\n @handler.get(handler.HTML)\n def get(self):\n \"\"\"Handle a get request.\"\"\"", " dest = self.request.get('dest')\n base_handler.check_redirect_url(dest)\n", " self.render(\n 'login.html', {\n 'apiKey': local_config.ProjectConfig().get('f...
[ 1, 1, 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 200, "char_start": 121, "chars": "dest = self.request.get('dest')\n base_handler.check_redirect_url(dest)\n\n " } ], "deleted": [ { "char_end": 318, "char_start": 300, "chars": "self.reques...
186
cwe-079
py
Determine whether the {function_name} code is vulnerable or not.
[ "def manipulate_reservation_action(request: HttpRequest, default_foreward_url: str):\n \"\"\"\n This function is used to alter the reservation beeing build inside\n a cookie. This function automatically crafts the required response.\n \"\"\"\n js_string: str = \"\"\n r: GroupReservation = None\n ...
[ 1, 0, 1, 0, 1, 0, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 899, "char_start": 892, "chars": "escape(" }, { "char_end": 921, "char_start": 920, "chars": ")" }, { "char_end": 1781, "char_start": 1774, "chars": "escape(" },...
187
cwe-079
py
Determine whether the {function_name} code is vulnerable or not.
[ "def manipulate_reservation_action(request: HttpRequest, default_foreward_url: str):\n \"\"\"\n This function is used to alter the reservation beeing build inside\n a cookie. This function automatically crafts the required response.\n \"\"\"\n js_string: str = \"\"\n r: GroupReservation = None\n ...
[ 1, 1, 1, 1, 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 899, "char_start": 892, "chars": "escape(" }, { "char_end": 921, "char_start": 920, "chars": ")" }, { "char_end": 1781, "char_start": 1774, "chars": "escape(" },...
187
cwe-079
py
Determine whether the {function_name} code is vulnerable or not.
[ "@property\n async def html_content(self):", " content = await self.content", " if not content:\n return ''\n return markdown(content)" ]
[ 1, 0, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 84, "char_start": 66, "chars": "markupsafe.escape(" }, { "char_end": 103, "char_start": 102, "chars": ")" } ], "deleted": [] }, "commit_link": "github.com/dongweiming/lyanna/commit/fcef...
188
cwe-079
py
Determine whether the {function_name} code is vulnerable or not.
[ "@property\n async def html_content(self):", " content = markupsafe.escape(await self.content)", " if not content:\n return ''\n return markdown(content)" ]
[ 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 84, "char_start": 66, "chars": "markupsafe.escape(" }, { "char_end": 103, "char_start": 102, "chars": ")" } ], "deleted": [] }, "commit_link": "github.com/dongweiming/lyanna/commit/fcef...
188
cwe-079
py
Determine whether the {function_name} code is vulnerable or not.
[ "def get_context_data(self, *args, **kwargs):\n data = super().get_context_data(*args, **kwargs)\n", " if self.request.GET.get('back', None) is not None:\n data['back_link'] = self.request.GET['back']", "\n return data" ]
[ 1, 0, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 121, "char_start": 115, "chars": "back =" }, { "char_end": 307, "char_start": 156, "chars": "\n parsed_back_url = urllib.parse.urlparse(back)\n\n # We only allow blank scheme, e.g. relative...
189
cwe-079
py
Determine whether the {function_name} code is vulnerable or not.
[ "def get_context_data(self, *args, **kwargs):\n data = super().get_context_data(*args, **kwargs)\n", " back = self.request.GET.get('back', None)\n parsed_back_url = urllib.parse.urlparse(back)", " # We only allow blank scheme, e.g. relative urls to avoid reflected XSS\n if bac...
[ 1, 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 121, "char_start": 115, "chars": "back =" }, { "char_end": 307, "char_start": 156, "chars": "\n parsed_back_url = urllib.parse.urlparse(back)\n\n # We only allow blank scheme, e.g. relative...
189
cwe-079
py
Determine whether the {function_name} code is vulnerable or not.
[ "def add_article_action(request: HttpRequest, default_foreward_url: str):\n forward_url: str = default_foreward_url\n if request.GET.get(\"redirect\"):\n forward_url = request.GET[\"redirect\"]\n else:\n forward_url = \"/admin\"\n if \"rid\" not in request.GET:\n return HttpResponse...
[ 1, 0, 1, 0, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 982, "char_start": 975, "chars": "escape(" }, { "char_end": 1004, "char_start": 1003, "chars": ")" }, { "char_end": 2237, "char_start": 2230, "chars": "escape(" ...
190
cwe-079
py
Determine whether the {function_name} code is vulnerable or not.
[ "def add_article_action(request: HttpRequest, default_foreward_url: str):\n forward_url: str = default_foreward_url\n if request.GET.get(\"redirect\"):\n forward_url = request.GET[\"redirect\"]\n else:\n forward_url = \"/admin\"\n if \"rid\" not in request.GET:\n return HttpResponse...
[ 1, 1, 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 982, "char_start": 975, "chars": "escape(" }, { "char_end": 1004, "char_start": 1003, "chars": ")" }, { "char_end": 2237, "char_start": 2230, "chars": "escape(" ...
190
cwe-079
py
Determine whether the {function_name} code is vulnerable or not.
[ "def build_board(conn, game,size):\n # we'll build the empty board, and then fill in with the move list that\n # we get from the DB.\n board = []\n for i in range(size):\n board.append([\"\"]*size)", "\n # search for all moves that have happenend during this game.\n cursor = conn.cursor()...
[ 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 372, "char_start": 371, "chars": "," }, { "char_end": 374, "char_start": 373, "chars": "(" }, { "char_end": 380, "char_start": 378, "chars": ",)" } ], "d...
191
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def build_board(conn, game,size):\n # we'll build the empty board, and then fill in with the move list that\n # we get from the DB.\n board = []\n for i in range(size):\n board.append([\"\"]*size)", "\n # search for all moves that have happenend during this game.\n cursor = conn.cursor()...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 372, "char_start": 371, "chars": "," }, { "char_end": 374, "char_start": 373, "chars": "(" }, { "char_end": 380, "char_start": 378, "chars": ",)" } ], "d...
191
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def check_and_update_ranks(self, scene):\n # There are 2 cases here:\n # 1) Ranks have never been calculated for this scene before\n # - This means we need to calculate what the ranks were every month of this scenes history\n # - We should only do this if ranks don't alrea...
[ 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 824, "char_start": 819, "chars": "scene" }, { "char_end": 837, "char_start": 828, "chars": "\n " }, { "char_end": 846, "char_start": 838, "chars": "rgs = {'" ...
192
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def check_and_update_ranks(self, scene):\n # There are 2 cases here:\n # 1) Ranks have never been calculated for this scene before\n # - This means we need to calculate what the ranks were every month of this scenes history\n # - We should only do this if ranks don't alrea...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 824, "char_start": 819, "chars": "scene" }, { "char_end": 837, "char_start": 828, "chars": "\n " }, { "char_end": 846, "char_start": 838, "chars": "rgs = {'" ...
192
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def tag_num_to_tag(self, tag_num):\n ''' Returns tag given tag_num. '''\n", " q = \"SELECT tag FROM tags WHERE rowid = '\" + str(tag_num) + \"'\"\n self.query(q)", " return self.c.fetchone()[0]" ]
[ 1, 0, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 132, "char_start": 131, "chars": "?" }, { "char_end": 163, "char_start": 154, "chars": ", tag_num" } ], "deleted": [ { "char_end": 153, "char_start": 131, "cha...
193
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def tag_num_to_tag(self, tag_num):\n ''' Returns tag given tag_num. '''\n", " q = \"SELECT tag FROM tags WHERE rowid = ?\"\n self.query(q, tag_num)", " return self.c.fetchone()[0]" ]
[ 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 132, "char_start": 131, "chars": "?" }, { "char_end": 163, "char_start": 154, "chars": ", tag_num" } ], "deleted": [ { "char_end": 153, "char_start": 131, "cha...
193
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "@api.route('/items/<int:item_id>', methods=['GET'])\ndef get_item(item_id):", " sql = '''SELECT id, name_enus FROM tblDBCItem WHERE id = {} AND auctionable = true;'''.format(item_id)", " cursor = mysql.connection.cursor()", " cursor.execute(sql)", " data = cursor.fetchone()", " if data:\n ...
[ 1, 0, 1, 0, 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 138, "char_start": 136, "chars": "%s" }, { "char_end": 238, "char_start": 227, "chars": ", [item_id]" } ], "deleted": [ { "char_end": 138, "char_start": 136, "...
194
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "@api.route('/items/<int:item_id>', methods=['GET'])\ndef get_item(item_id):", " sql = '''SELECT id, name_enus FROM tblDBCItem WHERE id = %s AND auctionable = true;'''", " cursor = mysql.connection.cursor()", " cursor.execute(sql, [item_id])", " data = cursor.fetchone()", " if data:\n ...
[ 1, 1, 1, 1, 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 138, "char_start": 136, "chars": "%s" }, { "char_end": 238, "char_start": 227, "chars": ", [item_id]" } ], "deleted": [ { "char_end": 138, "char_start": 136, "...
194
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def getPostsByPostid(self,postid):\n sqlText=\"select users.name,post.comment from users,post where \\", " users.userid=post.userid and post.postid=%d\"%(postid)\n result=sql.queryDB(self.conn,sqlText)", " return result;" ]
[ 1, 0, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 170, "char_start": 169, "chars": "s" }, { "char_end": 188, "char_start": 171, "chars": "\n params=[" }, { "char_end": 195, "char_start": 194, "chars": "]" ...
195
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def getPostsByPostid(self,postid):\n sqlText=\"select users.name,post.comment from users,post where \\", " users.userid=post.userid and post.postid=%s\"\n params=[postid]\n result=sql.queryDB(self.conn,sqlText,params)", " return result;" ]
[ 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 170, "char_start": 169, "chars": "s" }, { "char_end": 188, "char_start": 171, "chars": "\n params=[" }, { "char_end": 195, "char_start": 194, "chars": "]" ...
195
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def getFileCacheID(self, pth):\n\t\t\"\"\"\n\t\tReturns ID of a cached file on Telegram from DB. None if file doesn't exist or has no cached ID.\n\t\t:param pth:\n\t\t:return:\n\t\t\"\"\"", "\t\tcommand = \"SELECT file_id FROM {0} WHERE path='{1}'\".format(TABLE_NAME, pth)\n\t\tdata = self._run_command(command)"...
[ 1, 0, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 218, "char_start": 216, "chars": "?;" }, { "char_end": 247, "char_start": 237, "chars": ")\n\t\tparams" }, { "char_end": 251, "char_start": 248, "chars": "= (" }...
196
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def getFileCacheID(self, pth):\n\t\t\"\"\"\n\t\tReturns ID of a cached file on Telegram from DB. None if file doesn't exist or has no cached ID.\n\t\t:param pth:\n\t\t:return:\n\t\t\"\"\"", "\t\tcommand = \"SELECT file_id FROM {0} WHERE path=?;\".format(TABLE_NAME)\n\t\tparams = (pth,)\n\t\tdata = self._run_comm...
[ 1, 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 218, "char_start": 216, "chars": "?;" }, { "char_end": 247, "char_start": 237, "chars": ")\n\t\tparams" }, { "char_end": 251, "char_start": 248, "chars": "= (" }...
196
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def add_post(content):\n \"\"\"Add a post to the 'database' with the current timestamp.\"\"\"\n db = psycopg2.connect(database=DBNAME)\n c = db.cursor()", " c.execute(\"insert into posts values('%s')\" % content)", " db.commit()\n db.close()" ]
[ 1, 0, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 191, "char_start": 189, "chars": ",(" }, { "char_end": 200, "char_start": 198, "chars": ",)" } ], "deleted": [ { "char_end": 186, "char_start": 185, "chars": "...
197
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def add_post(content):\n \"\"\"Add a post to the 'database' with the current timestamp.\"\"\"\n db = psycopg2.connect(database=DBNAME)\n c = db.cursor()", " c.execute(\"insert into posts values(%s)\",(content,))", " db.commit()\n db.close()" ]
[ 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 191, "char_start": 189, "chars": ",(" }, { "char_end": 200, "char_start": 198, "chars": ",)" } ], "deleted": [ { "char_end": 186, "char_start": 185, "chars": "...
197
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def getSubmissionDateFromDatabase(submission):\n database = sqlite3.connect('database.db')\n cursor = database.cursor()", " return cursor.execute(\"SELECT Date FROM ChallengeRankings WHERE SubmissionID = '\" + str(submission.id) + \"'\").fetchone()[0]", " database.close()" ]
[ 1, 0, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 208, "char_start": 207, "chars": "?" }, { "char_end": 210, "char_start": 209, "chars": "," }, { "char_end": 212, "char_start": 211, "chars": "[" }, { ...
198
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "def getSubmissionDateFromDatabase(submission):\n database = sqlite3.connect('database.db')\n cursor = database.cursor()", " return cursor.execute(\"SELECT Date FROM ChallengeRankings WHERE SubmissionID = ?\", [str(submission.id)]).fetchone()[0]", " database.close()" ]
[ 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 208, "char_start": 207, "chars": "?" }, { "char_end": 210, "char_start": 209, "chars": "," }, { "char_end": 212, "char_start": 211, "chars": "[" }, { ...
198
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "@endpoints.route(\"/ranks\")\ndef ranks():\n if db == None:\n init()", " scene = request.args.get('scene', default='austin')\n date = request.args.get('date')\n \n # If no date was provided, pick the date of the latest tournament\n if date == None:", " sql = \"SELECT distinct date ...
[ 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 326, "char_start": 321, "chars": "scene" }, { "char_end": 366, "char_start": 357, "chars": "\n " }, { "char_end": 375, "char_start": 367, "chars": "rgs = {'" ...
199
cwe-089
py
Determine whether the {function_name} code is vulnerable or not.
[ "@endpoints.route(\"/ranks\")\ndef ranks():\n if db == None:\n init()", " scene = request.args.get('scene', default='austin')\n date = request.args.get('date')\n \n # If no date was provided, pick the date of the latest tournament\n if date == None:", " sql = \"SELECT distinct date ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
SVEN
{ "char_changes": { "added": [ { "char_end": 326, "char_start": 321, "chars": "scene" }, { "char_end": 366, "char_start": 357, "chars": "\n " }, { "char_end": 375, "char_start": 367, "chars": "rgs = {'" ...
199
cwe-089
py