init
This commit is contained in:
commit
303438d206
217 files changed
+66681
No files matched your search
+1410
File diff suppressed because it is too large.
Load diff
+992
@@ -0,0 +1,992 @@
|
||||
{
|
||||
"schema_version": 1,
|
||||
"description": "Independently authored 1.7.0 detector regressions. Source is inert data, never executed. Authored rule examples are not counted here.",
|
||||
"cases": [
|
||||
{
|
||||
"id": "py-auth-decorator-python-positive-1",
|
||||
"language": "python",
|
||||
"source": "import flask as web\nfrom flask_login import login_required as authorized\nviews=web.Blueprint('views', __name__)\n@authorized\n@views.post('/notes')\ndef create_note():\n pass",
|
||||
"expected": [
|
||||
"PY-AUTH-DECORATOR"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Independent positive regression; inert source text, never executed."
|
||||
},
|
||||
{
|
||||
"id": "py-auth-decorator-python-positive-2",
|
||||
"language": "python",
|
||||
"source": "from flask import Flask as Application\nimport flask_login as auth\nserver=Application('service')\n@auth.login_required\n@server.get('/files')\ndef files():\n return []",
|
||||
"expected": [
|
||||
"PY-AUTH-DECORATOR"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Independent positive regression; inert source text, never executed."
|
||||
},
|
||||
{
|
||||
"id": "py-auth-decorator-python-negative-1",
|
||||
"language": "python",
|
||||
"source": "from flask import Flask\nfrom flask_login import login_required\nsite=Flask('service')\n@site.route('/files')\n@login_required\ndef files():\n return []",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"PY-AUTH-DECORATOR"
|
||||
],
|
||||
"note": "Independent safe/context-negative regression; no security verdict about other operations."
|
||||
},
|
||||
{
|
||||
"id": "py-auth-decorator-python-negative-2",
|
||||
"language": "python",
|
||||
"source": "from flask import Flask\nfrom flask_login import login_required\nsite=Flask('service')\nlogin_required=custom_decorator\n@login_required\n@site.route('/public')\ndef files():\n pass",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"PY-AUTH-DECORATOR"
|
||||
],
|
||||
"note": "Independent safe/context-negative regression; no security verdict about other operations."
|
||||
},
|
||||
{
|
||||
"id": "py-auth-decorator-python-negative-3",
|
||||
"language": "python",
|
||||
"source": "from flask import Flask\nfrom flask_login import login_required\nsite=Flask('service')\nsite=custom_router\n@login_required\n@site.route('/custom')\ndef files():\n pass",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"PY-AUTH-DECORATOR"
|
||||
],
|
||||
"note": "Independent safe/context-negative regression; no security verdict about other operations."
|
||||
},
|
||||
{
|
||||
"id": "py-auth-decorator-python-negative-4",
|
||||
"language": "python",
|
||||
"source": "# @login_required\ntext='@app.route(...)'\ndef ordinary():\n pass",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"PY-AUTH-DECORATOR"
|
||||
],
|
||||
"note": "Independent safe/context-negative regression; no security verdict about other operations."
|
||||
},
|
||||
{
|
||||
"id": "py-log-credentials-python-positive-1",
|
||||
"language": "python",
|
||||
"source": "import logging as audit\naudit.error('key was %s', record.api_key)",
|
||||
"expected": [
|
||||
"PY-LOG-CREDENTIALS"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Independent positive regression; inert source text, never executed."
|
||||
},
|
||||
{
|
||||
"id": "py-log-credentials-python-positive-2",
|
||||
"language": "python",
|
||||
"source": "from logging import getLogger as get_log\nlog=get_log('service')\nlog.debug(f'failed login: {request.headers[\"Authorization\"]}')",
|
||||
"expected": [
|
||||
"PY-LOG-CREDENTIALS"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Independent positive regression; inert source text, never executed."
|
||||
},
|
||||
{
|
||||
"id": "py-log-credentials-python-negative-1",
|
||||
"language": "python",
|
||||
"source": "import logging\nlogging.info('authentication rejected')",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"PY-LOG-CREDENTIALS"
|
||||
],
|
||||
"note": "Independent safe/context-negative regression; no security verdict about other operations."
|
||||
},
|
||||
{
|
||||
"id": "py-log-credentials-python-negative-2",
|
||||
"language": "python",
|
||||
"source": "import logging\nlogger=logging.getLogger('service')\nlogger.warning('key %s', redact(token))",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"PY-LOG-CREDENTIALS"
|
||||
],
|
||||
"note": "Independent safe/context-negative regression; no security verdict about other operations."
|
||||
},
|
||||
{
|
||||
"id": "py-log-credentials-python-negative-3",
|
||||
"language": "python",
|
||||
"source": "import logging\ndef run(logging):\n logging.error(password)",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"PY-LOG-CREDENTIALS"
|
||||
],
|
||||
"note": "Independent safe/context-negative regression; no security verdict about other operations."
|
||||
},
|
||||
{
|
||||
"id": "py-log-credentials-python-negative-4",
|
||||
"language": "python",
|
||||
"source": "import logging\nlogging=custom_logger\nlogging.warning(token)",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"PY-LOG-CREDENTIALS"
|
||||
],
|
||||
"note": "Independent safe/context-negative regression; no security verdict about other operations."
|
||||
},
|
||||
{
|
||||
"id": "py-log-credentials-python-negative-5",
|
||||
"language": "python",
|
||||
"source": "# logging.info(password)\nmessage='logging.debug(token)'",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"PY-LOG-CREDENTIALS"
|
||||
],
|
||||
"note": "Independent safe/context-negative regression; no security verdict about other operations."
|
||||
},
|
||||
{
|
||||
"id": "js-redirect-input-javascript-positive-1",
|
||||
"language": "javascript",
|
||||
"source": "response.redirect(303, request.body.destination);",
|
||||
"expected": [
|
||||
"JS-REDIRECT-INPUT"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Independent positive regression; inert source text, never executed."
|
||||
},
|
||||
{
|
||||
"id": "js-redirect-input-javascript-positive-2",
|
||||
"language": "javascript",
|
||||
"source": "res.redirect(\n req.params.returnPath\n);",
|
||||
"expected": [
|
||||
"JS-REDIRECT-INPUT"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Independent positive regression; inert source text, never executed."
|
||||
},
|
||||
{
|
||||
"id": "js-redirect-input-javascript-negative-1",
|
||||
"language": "javascript",
|
||||
"source": "res.redirect(302, '/notes');",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"JS-REDIRECT-INPUT"
|
||||
],
|
||||
"note": "Independent safe/context-negative regression; no security verdict about other operations."
|
||||
},
|
||||
{
|
||||
"id": "js-redirect-input-javascript-negative-2",
|
||||
"language": "javascript",
|
||||
"source": "custom.redirect(req.query.next);",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"JS-REDIRECT-INPUT"
|
||||
],
|
||||
"note": "Independent safe/context-negative regression; no security verdict about other operations."
|
||||
},
|
||||
{
|
||||
"id": "js-redirect-input-javascript-negative-3",
|
||||
"language": "javascript",
|
||||
"source": "// res.redirect(req.query.bad)\nconst example = 'response.redirect(request.body.next)';",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"JS-REDIRECT-INPUT"
|
||||
],
|
||||
"note": "Independent safe/context-negative regression; no security verdict about other operations."
|
||||
},
|
||||
{
|
||||
"id": "js-redirect-input-javascript-negative-4",
|
||||
"language": "javascript",
|
||||
"source": "/* res.redirect(req.query.next); */",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"JS-REDIRECT-INPUT"
|
||||
],
|
||||
"note": "Independent safe/context-negative regression; no security verdict about other operations."
|
||||
},
|
||||
{
|
||||
"id": "php-ldap-filter-php-positive-1",
|
||||
"language": "php",
|
||||
"source": "ldap_list($directory, $dn, \"(mail=\" . $mail . \")\");",
|
||||
"expected": [
|
||||
"PHP-LDAP-FILTER"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Independent positive regression; inert source text, never executed."
|
||||
},
|
||||
{
|
||||
"id": "php-ldap-filter-php-positive-2",
|
||||
"language": "php",
|
||||
"source": "ldap_read($ld, $baseDn, '(cn=' . $lookup . ')');",
|
||||
"expected": [
|
||||
"PHP-LDAP-FILTER"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Independent positive regression; inert source text, never executed."
|
||||
},
|
||||
{
|
||||
"id": "php-ldap-filter-php-negative-1",
|
||||
"language": "php",
|
||||
"source": "ldap_search($ld, $dn, '(uid=known)');",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"PHP-LDAP-FILTER"
|
||||
],
|
||||
"note": "Independent safe/context-negative regression; no security verdict about other operations."
|
||||
},
|
||||
{
|
||||
"id": "php-ldap-filter-php-negative-2",
|
||||
"language": "php",
|
||||
"source": "ldap_search($ld, $dn, '(uid=' . ldap_escape($lookup, '', LDAP_ESCAPE_FILTER) . ')');",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"PHP-LDAP-FILTER"
|
||||
],
|
||||
"note": "Independent safe/context-negative regression; no security verdict about other operations."
|
||||
},
|
||||
{
|
||||
"id": "php-ldap-filter-php-negative-3",
|
||||
"language": "php",
|
||||
"source": "// ldap_search($ld, $dn, '(uid=' . $lookup);\n$note = \"ldap_read($a, $b, '(uid=' . $c)\";",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"PHP-LDAP-FILTER"
|
||||
],
|
||||
"note": "Independent safe/context-negative regression; no security verdict about other operations."
|
||||
},
|
||||
{
|
||||
"id": "go-upload-path-go-positive-1",
|
||||
"language": "go",
|
||||
"source": "destination := filepath.Join(storage, fileHeader.Filename)",
|
||||
"expected": [
|
||||
"GO-UPLOAD-PATH"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Independent positive regression; inert source text, never executed."
|
||||
},
|
||||
{
|
||||
"id": "go-upload-path-go-positive-2",
|
||||
"language": "go",
|
||||
"source": "p := filepath.Join(\n base,\n file.Filename\n)",
|
||||
"expected": [
|
||||
"GO-UPLOAD-PATH"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Independent positive regression; inert source text, never executed."
|
||||
},
|
||||
{
|
||||
"id": "go-upload-path-go-negative-1",
|
||||
"language": "go",
|
||||
"source": "p := filepath.Join(storage, generatedName)",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"GO-UPLOAD-PATH"
|
||||
],
|
||||
"note": "Independent safe/context-negative regression; no security verdict about other operations."
|
||||
},
|
||||
{
|
||||
"id": "go-upload-path-go-negative-2",
|
||||
"language": "go",
|
||||
"source": "p := filepath.Join(storage, header.SafeName)",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"GO-UPLOAD-PATH"
|
||||
],
|
||||
"note": "Independent safe/context-negative regression; no security verdict about other operations."
|
||||
},
|
||||
{
|
||||
"id": "go-upload-path-go-negative-3",
|
||||
"language": "go",
|
||||
"source": "// filepath.Join(root, header.Filename)\nvar example = \"filepath.Join(root, file.Filename)\"",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"GO-UPLOAD-PATH"
|
||||
],
|
||||
"note": "Independent safe/context-negative regression; no security verdict about other operations."
|
||||
},
|
||||
{
|
||||
"id": "java-ldap-filter-java-positive-1",
|
||||
"language": "java",
|
||||
"source": "context.search(rootDn, \"(mail=\" + address + \")\", limits);",
|
||||
"expected": [
|
||||
"JAVA-LDAP-FILTER"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Independent positive regression; inert source text, never executed."
|
||||
},
|
||||
{
|
||||
"id": "java-ldap-filter-java-positive-2",
|
||||
"language": "java",
|
||||
"source": "dirContext.search(baseName, \"(cn=\" + supplied + \")\", searchControls);",
|
||||
"expected": [
|
||||
"JAVA-LDAP-FILTER"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Independent positive regression; inert source text, never executed."
|
||||
},
|
||||
{
|
||||
"id": "java-ldap-filter-java-negative-1",
|
||||
"language": "java",
|
||||
"source": "ctx.search(base, \"(uid={0})\", new Object[] { uid }, controls);",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"JAVA-LDAP-FILTER"
|
||||
],
|
||||
"note": "Independent safe/context-negative regression; no security verdict about other operations."
|
||||
},
|
||||
{
|
||||
"id": "java-ldap-filter-java-negative-2",
|
||||
"language": "java",
|
||||
"source": "custom.search(base, \"(uid=\" + name + \")\", controls);",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"JAVA-LDAP-FILTER"
|
||||
],
|
||||
"note": "Independent safe/context-negative regression; no security verdict about other operations."
|
||||
},
|
||||
{
|
||||
"id": "java-ldap-filter-java-negative-3",
|
||||
"language": "java",
|
||||
"source": "// ctx.search(base, \"(uid=\" + uid, controls);\nString help = \"context.search(base, filter)\";",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"JAVA-LDAP-FILTER"
|
||||
],
|
||||
"note": "Independent safe/context-negative regression; no security verdict about other operations."
|
||||
},
|
||||
{
|
||||
"id": "java-ldap-filter-java-negative-4",
|
||||
"language": "java",
|
||||
"source": "/* context.search(base, \"(cn=\" + name, controls); */",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"JAVA-LDAP-FILTER"
|
||||
],
|
||||
"note": "Independent safe/context-negative regression; no security verdict about other operations."
|
||||
},
|
||||
{
|
||||
"id": "cs-ldap-filter-csharp-positive-1",
|
||||
"language": "csharp",
|
||||
"source": "var lookup = new System.DirectoryServices.DirectorySearcher(\"(mail=\" + address + \")\");",
|
||||
"expected": [
|
||||
"CS-LDAP-FILTER"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Independent positive regression; inert source text, never executed."
|
||||
},
|
||||
{
|
||||
"id": "cs-ldap-filter-csharp-positive-2",
|
||||
"language": "csharp",
|
||||
"source": "using var ds = new DirectorySearcher(\n \"(cn=\" + supplied + \")\"\n);",
|
||||
"expected": [
|
||||
"CS-LDAP-FILTER"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Independent positive regression; inert source text, never executed."
|
||||
},
|
||||
{
|
||||
"id": "cs-ldap-filter-csharp-negative-1",
|
||||
"language": "csharp",
|
||||
"source": "var query = new DirectorySearcher(\"(uid=known)\");",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"CS-LDAP-FILTER"
|
||||
],
|
||||
"note": "Independent safe/context-negative regression; no security verdict about other operations."
|
||||
},
|
||||
{
|
||||
"id": "cs-ldap-filter-csharp-negative-2",
|
||||
"language": "csharp",
|
||||
"source": "var query = new DirectorySearcher(BuildLdapFilter(name));",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"CS-LDAP-FILTER"
|
||||
],
|
||||
"note": "Independent safe/context-negative regression; no security verdict about other operations."
|
||||
},
|
||||
{
|
||||
"id": "cs-ldap-filter-csharp-negative-3",
|
||||
"language": "csharp",
|
||||
"source": "// new DirectorySearcher(\"(uid=\" + user)\nvar note = \"DirectorySearcher\";",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"CS-LDAP-FILTER"
|
||||
],
|
||||
"note": "Independent safe/context-negative regression; no security verdict about other operations."
|
||||
},
|
||||
{
|
||||
"id": "ruby-redirect-input-ruby-positive-1",
|
||||
"language": "ruby",
|
||||
"source": "redirect_to(request.params[:return_path])",
|
||||
"expected": [
|
||||
"RUBY-REDIRECT-INPUT"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Independent positive regression; inert source text, never executed."
|
||||
},
|
||||
{
|
||||
"id": "ruby-redirect-input-ruby-positive-2",
|
||||
"language": "ruby",
|
||||
"source": "redirect_to params['destination']",
|
||||
"expected": [
|
||||
"RUBY-REDIRECT-INPUT"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Independent positive regression; inert source text, never executed."
|
||||
},
|
||||
{
|
||||
"id": "ruby-redirect-input-ruby-negative-1",
|
||||
"language": "ruby",
|
||||
"source": "redirect_to dashboard_path",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"RUBY-REDIRECT-INPUT"
|
||||
],
|
||||
"note": "Independent safe/context-negative regression; no security verdict about other operations."
|
||||
},
|
||||
{
|
||||
"id": "ruby-redirect-input-ruby-negative-2",
|
||||
"language": "ruby",
|
||||
"source": "redirect_to '/notes'",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"RUBY-REDIRECT-INPUT"
|
||||
],
|
||||
"note": "Independent safe/context-negative regression; no security verdict about other operations."
|
||||
},
|
||||
{
|
||||
"id": "ruby-redirect-input-ruby-negative-3",
|
||||
"language": "ruby",
|
||||
"source": "# redirect_to params[:next]\ntext = 'redirect_to(params[:next])'",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"RUBY-REDIRECT-INPUT"
|
||||
],
|
||||
"note": "Independent safe/context-negative regression; no security verdict about other operations."
|
||||
},
|
||||
{
|
||||
"id": "rust-unbounded-read-rust-positive-1",
|
||||
"language": "rust",
|
||||
"source": "socket.read_to_string(&mut received)?;",
|
||||
"expected": [
|
||||
"RUST-UNBOUNDED-READ"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Independent positive regression; inert source text, never executed."
|
||||
},
|
||||
{
|
||||
"id": "rust-unbounded-read-rust-positive-2",
|
||||
"language": "rust",
|
||||
"source": "reader.read_to_end(&mut data).unwrap();",
|
||||
"expected": [
|
||||
"RUST-UNBOUNDED-READ"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Independent positive regression; inert source text, never executed."
|
||||
},
|
||||
{
|
||||
"id": "rust-unbounded-read-rust-negative-1",
|
||||
"language": "rust",
|
||||
"source": "let mut bounded = socket.take(limit + 1);\nbounded.read_to_string(&mut text)?;",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"RUST-UNBOUNDED-READ"
|
||||
],
|
||||
"note": "Independent safe/context-negative regression; no security verdict about other operations."
|
||||
},
|
||||
{
|
||||
"id": "rust-unbounded-read-rust-negative-2",
|
||||
"language": "rust",
|
||||
"source": "parser.read_to_end(&mut fixed)?;",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"RUST-UNBOUNDED-READ"
|
||||
],
|
||||
"note": "Independent safe/context-negative regression; no security verdict about other operations."
|
||||
},
|
||||
{
|
||||
"id": "rust-unbounded-read-rust-negative-3",
|
||||
"language": "rust",
|
||||
"source": "// socket.read_to_end(&mut bytes)?;\nlet note = \"stream.read_to_string(&mut text)\";",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"RUST-UNBOUNDED-READ"
|
||||
],
|
||||
"note": "Independent safe/context-negative regression; no security verdict about other operations."
|
||||
},
|
||||
{
|
||||
"id": "c-copy-length-native-positive-1",
|
||||
"language": "native",
|
||||
"source": "memmove(output, name, strnlen(name, maximum) + 1);",
|
||||
"expected": [
|
||||
"C-COPY-LENGTH"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Independent positive regression; inert source text, never executed."
|
||||
},
|
||||
{
|
||||
"id": "c-copy-length-native-positive-2",
|
||||
"language": "native",
|
||||
"source": "memcpy(\n buffer, text,\n strlen(text)\n);",
|
||||
"expected": [
|
||||
"C-COPY-LENGTH"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Independent positive regression; inert source text, never executed."
|
||||
},
|
||||
{
|
||||
"id": "c-copy-length-native-negative-1",
|
||||
"language": "native",
|
||||
"source": "memcpy(buffer, text, checked_length);",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"C-COPY-LENGTH"
|
||||
],
|
||||
"note": "Independent safe/context-negative regression; no security verdict about other operations."
|
||||
},
|
||||
{
|
||||
"id": "c-copy-length-native-negative-2",
|
||||
"language": "native",
|
||||
"source": "memmove(dst, src, sizeof known_array);",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"C-COPY-LENGTH"
|
||||
],
|
||||
"note": "Independent safe/context-negative regression; no security verdict about other operations."
|
||||
},
|
||||
{
|
||||
"id": "c-copy-length-native-negative-3",
|
||||
"language": "native",
|
||||
"source": "/* memcpy(buffer, data, strlen(data)); */\nconst char *s = \"memcpy(buffer,data,strlen(data))\";",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"C-COPY-LENGTH"
|
||||
],
|
||||
"note": "Independent safe/context-negative regression; no security verdict about other operations."
|
||||
},
|
||||
{
|
||||
"id": "cfg-cookie-flags-config-positive-1",
|
||||
"language": "config",
|
||||
"source": "SESSION_COOKIE_SECURE = false",
|
||||
"expected": [
|
||||
"CFG-COOKIE-FLAGS"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Independent positive regression; inert source text, never executed."
|
||||
},
|
||||
{
|
||||
"id": "cfg-cookie-flags-config-positive-2",
|
||||
"language": "config",
|
||||
"source": "CSRF_COOKIE_SECURE = 0",
|
||||
"expected": [
|
||||
"CFG-COOKIE-FLAGS"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Independent positive regression; inert source text, never executed."
|
||||
},
|
||||
{
|
||||
"id": "cfg-cookie-flags-config-negative-1",
|
||||
"language": "config",
|
||||
"source": "SESSION_COOKIE_HTTPONLY = true",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"CFG-COOKIE-FLAGS"
|
||||
],
|
||||
"note": "Independent safe/context-negative regression; no security verdict about other operations."
|
||||
},
|
||||
{
|
||||
"id": "cfg-cookie-flags-config-negative-2",
|
||||
"language": "config",
|
||||
"source": "SESSION_COOKIE_SECURE = true",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"CFG-COOKIE-FLAGS"
|
||||
],
|
||||
"note": "Independent safe/context-negative regression; no security verdict about other operations."
|
||||
},
|
||||
{
|
||||
"id": "cfg-cookie-flags-config-negative-3",
|
||||
"language": "config",
|
||||
"source": "# SESSION_COOKIE_HTTPONLY = false\nexample = \"SESSION_COOKIE_SECURE = false\"",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"CFG-COOKIE-FLAGS"
|
||||
],
|
||||
"note": "Independent safe/context-negative regression; no security verdict about other operations."
|
||||
},
|
||||
{
|
||||
"id": "cfg-cookie-flags-python-positive-1",
|
||||
"language": "python",
|
||||
"source": "SESSION_COOKIE_SECURE = False",
|
||||
"expected": [
|
||||
"CFG-COOKIE-FLAGS"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Independent positive regression; inert source text, never executed."
|
||||
},
|
||||
{
|
||||
"id": "cfg-cookie-flags-python-positive-2",
|
||||
"language": "python",
|
||||
"source": "CSRF_COOKIE_SECURE = 0",
|
||||
"expected": [
|
||||
"CFG-COOKIE-FLAGS"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Independent positive regression; inert source text, never executed."
|
||||
},
|
||||
{
|
||||
"id": "cfg-cookie-flags-python-negative-1",
|
||||
"language": "python",
|
||||
"source": "SESSION_COOKIE_HTTPONLY = True",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"CFG-COOKIE-FLAGS"
|
||||
],
|
||||
"note": "Independent safe/context-negative regression; no security verdict about other operations."
|
||||
},
|
||||
{
|
||||
"id": "cfg-cookie-flags-python-negative-2",
|
||||
"language": "python",
|
||||
"source": "SESSION_COOKIE_SECURE = True",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"CFG-COOKIE-FLAGS"
|
||||
],
|
||||
"note": "Independent safe/context-negative regression; no security verdict about other operations."
|
||||
},
|
||||
{
|
||||
"id": "cfg-cookie-flags-python-negative-3",
|
||||
"language": "python",
|
||||
"source": "# SESSION_COOKIE_HTTPONLY = False\nexample = \"SESSION_COOKIE_SECURE = False\"",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"CFG-COOKIE-FLAGS"
|
||||
],
|
||||
"note": "Independent safe/context-negative regression; no security verdict about other operations."
|
||||
},
|
||||
{
|
||||
"id": "cfg-docker-tcp-shell-positive-1",
|
||||
"language": "shell",
|
||||
"source": "dockerd --host=tcp://[::]:2376",
|
||||
"expected": [
|
||||
"CFG-DOCKER-TCP"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Independent positive regression; inert source text, never executed."
|
||||
},
|
||||
{
|
||||
"id": "cfg-docker-tcp-shell-positive-2",
|
||||
"language": "shell",
|
||||
"source": "dockerd --debug -H tcp://0.0.0.0:4243",
|
||||
"expected": [
|
||||
"CFG-DOCKER-TCP"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Independent positive regression; inert source text, never executed."
|
||||
},
|
||||
{
|
||||
"id": "cfg-docker-tcp-shell-negative-1",
|
||||
"language": "shell",
|
||||
"source": "dockerd -H unix:///var/run/docker.sock",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"CFG-DOCKER-TCP"
|
||||
],
|
||||
"note": "Independent safe/context-negative regression; no security verdict about other operations."
|
||||
},
|
||||
{
|
||||
"id": "cfg-docker-tcp-shell-negative-2",
|
||||
"language": "shell",
|
||||
"source": "dockerd --host=tcp://127.0.0.1:2376",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"CFG-DOCKER-TCP"
|
||||
],
|
||||
"note": "Independent safe/context-negative regression; no security verdict about other operations."
|
||||
},
|
||||
{
|
||||
"id": "cfg-docker-tcp-shell-negative-3",
|
||||
"language": "shell",
|
||||
"source": "# dockerd -H tcp://0.0.0.0:2375\necho \"dockerd --host=tcp://0.0.0.0:2375\"",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"CFG-DOCKER-TCP"
|
||||
],
|
||||
"note": "Independent safe/context-negative regression; no security verdict about other operations."
|
||||
},
|
||||
{
|
||||
"id": "cfg-docker-tcp-docker-positive-1",
|
||||
"language": "docker",
|
||||
"source": "RUN dockerd --host=tcp://[::]:2376",
|
||||
"expected": [
|
||||
"CFG-DOCKER-TCP"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Independent positive regression; inert source text, never executed."
|
||||
},
|
||||
{
|
||||
"id": "cfg-docker-tcp-docker-positive-2",
|
||||
"language": "docker",
|
||||
"source": "RUN dockerd --debug -H tcp://0.0.0.0:4243",
|
||||
"expected": [
|
||||
"CFG-DOCKER-TCP"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Independent positive regression; inert source text, never executed."
|
||||
},
|
||||
{
|
||||
"id": "cfg-docker-tcp-docker-negative-1",
|
||||
"language": "docker",
|
||||
"source": "RUN dockerd -H unix:///var/run/docker.sock",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"CFG-DOCKER-TCP"
|
||||
],
|
||||
"note": "Independent safe/context-negative regression; no security verdict about other operations."
|
||||
},
|
||||
{
|
||||
"id": "cfg-docker-tcp-docker-negative-2",
|
||||
"language": "docker",
|
||||
"source": "RUN dockerd --host=tcp://127.0.0.1:2376",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"CFG-DOCKER-TCP"
|
||||
],
|
||||
"note": "Independent safe/context-negative regression; no security verdict about other operations."
|
||||
},
|
||||
{
|
||||
"id": "cfg-docker-tcp-docker-negative-3",
|
||||
"language": "docker",
|
||||
"source": "# dockerd -H tcp://0.0.0.0:2375\nRUN echo \"dockerd --host=tcp://0.0.0.0:2375\"",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"CFG-DOCKER-TCP"
|
||||
],
|
||||
"note": "Independent safe/context-negative regression; no security verdict about other operations."
|
||||
},
|
||||
{
|
||||
"id": "cfg-floating-image-docker-positive-1",
|
||||
"language": "docker",
|
||||
"source": "FROM --platform=linux/arm64 registry.example.invalid/team/ui:latest AS build",
|
||||
"expected": [
|
||||
"CFG-FLOATING-IMAGE"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Independent positive regression; inert source text, never executed."
|
||||
},
|
||||
{
|
||||
"id": "cfg-floating-image-docker-positive-2",
|
||||
"language": "docker",
|
||||
"source": "FROM registry.example.invalid:5000/tools/worker:latest",
|
||||
"expected": [
|
||||
"CFG-FLOATING-IMAGE"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Independent positive regression; inert source text, never executed."
|
||||
},
|
||||
{
|
||||
"id": "cfg-floating-image-docker-negative-1",
|
||||
"language": "docker",
|
||||
"source": "FROM registry.example.invalid/app:2.0",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"CFG-FLOATING-IMAGE"
|
||||
],
|
||||
"note": "Independent safe/context-negative regression; no security verdict about other operations."
|
||||
},
|
||||
{
|
||||
"id": "cfg-floating-image-docker-negative-2",
|
||||
"language": "docker",
|
||||
"source": "FROM registry.example.invalid/app:latest@sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"CFG-FLOATING-IMAGE"
|
||||
],
|
||||
"note": "Independent safe/context-negative regression; no security verdict about other operations."
|
||||
},
|
||||
{
|
||||
"id": "cfg-floating-image-docker-negative-3",
|
||||
"language": "docker",
|
||||
"source": "# FROM example.invalid/app:latest\nRUN echo 'FROM example.invalid/app:latest'",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"CFG-FLOATING-IMAGE"
|
||||
],
|
||||
"note": "Independent safe/context-negative regression; no security verdict about other operations."
|
||||
},
|
||||
{
|
||||
"id": "cfg-floating-image-config-positive-1",
|
||||
"language": "config",
|
||||
"source": "services:\n farm:\n image: registry.example.invalid/farm:latest",
|
||||
"expected": [
|
||||
"CFG-FLOATING-IMAGE"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Independent positive regression; inert source text, never executed."
|
||||
},
|
||||
{
|
||||
"id": "cfg-floating-image-config-positive-2",
|
||||
"language": "config",
|
||||
"source": "image: registry.example.invalid:5000/neo:latest\n",
|
||||
"expected": [
|
||||
"CFG-FLOATING-IMAGE"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Independent positive regression; inert source text, never executed."
|
||||
},
|
||||
{
|
||||
"id": "cfg-floating-image-config-negative-1",
|
||||
"language": "config",
|
||||
"source": "image: registry.example.invalid/farm:1.0",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"CFG-FLOATING-IMAGE"
|
||||
],
|
||||
"note": "Independent safe/context-negative regression; no security verdict about other operations."
|
||||
},
|
||||
{
|
||||
"id": "cfg-floating-image-config-negative-2",
|
||||
"language": "config",
|
||||
"source": "image: registry.example.invalid/neo:latest@sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"CFG-FLOATING-IMAGE"
|
||||
],
|
||||
"note": "Independent safe/context-negative regression; no security verdict about other operations."
|
||||
},
|
||||
{
|
||||
"id": "cfg-floating-image-config-negative-3",
|
||||
"language": "config",
|
||||
"source": "# image: registry.example.invalid/farm:latest\nnote: 'image: registry.example.invalid/farm:latest'",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"CFG-FLOATING-IMAGE"
|
||||
],
|
||||
"note": "Independent safe/context-negative regression; no security verdict about other operations."
|
||||
},
|
||||
{
|
||||
"id": "cfg-floating-image-docker-negative-instruction",
|
||||
"language": "docker",
|
||||
"source": "RUN echo FROM example.invalid/app:latest\nENV instruction=image: example.invalid/app:latest",
|
||||
"expected": [],
|
||||
"forbidden": ["CFG-FLOATING-IMAGE"],
|
||||
"note": "Unquoted shell output and ENV text are not Docker base image instructions."
|
||||
},
|
||||
{
|
||||
"id": "cfg-floating-image-config-negative-scalar",
|
||||
"language": "config",
|
||||
"source": "description: image: example.invalid/app:latest\ncommand: echo FROM example.invalid/app:latest",
|
||||
"expected": [],
|
||||
"forbidden": ["CFG-FLOATING-IMAGE"],
|
||||
"note": "Non-image configuration keys are not bare YAML image declarations."
|
||||
},
|
||||
{
|
||||
"id": "sql-rls-allow-all-sql-positive-1",
|
||||
"language": "sql",
|
||||
"source": "ALTER POLICY allow_updates ON records WITH CHECK (TRUE);",
|
||||
"expected": [
|
||||
"SQL-RLS-ALLOW-ALL"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Independent positive regression; inert source text, never executed."
|
||||
},
|
||||
{
|
||||
"id": "sql-rls-allow-all-sql-positive-2",
|
||||
"language": "sql",
|
||||
"source": "CREATE POLICY readable ON messages FOR SELECT USING (\n true\n);",
|
||||
"expected": [
|
||||
"SQL-RLS-ALLOW-ALL"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Independent positive regression; inert source text, never executed."
|
||||
},
|
||||
{
|
||||
"id": "sql-rls-allow-all-sql-negative-1",
|
||||
"language": "sql",
|
||||
"source": "CREATE POLICY owner_read ON records USING (owner_id = current_user);",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"SQL-RLS-ALLOW-ALL"
|
||||
],
|
||||
"note": "Independent safe/context-negative regression; no security verdict about other operations."
|
||||
},
|
||||
{
|
||||
"id": "sql-rls-allow-all-sql-negative-2",
|
||||
"language": "sql",
|
||||
"source": "ALTER POLICY owner_write ON records WITH CHECK (owner_id = current_user);",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"SQL-RLS-ALLOW-ALL"
|
||||
],
|
||||
"note": "Independent safe/context-negative regression; no security verdict about other operations."
|
||||
},
|
||||
{
|
||||
"id": "sql-rls-allow-all-sql-negative-3",
|
||||
"language": "sql",
|
||||
"source": "-- USING (true)\nSELECT 'WITH CHECK(true)';",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"SQL-RLS-ALLOW-ALL"
|
||||
],
|
||||
"note": "Independent safe/context-negative regression; no security verdict about other operations."
|
||||
},
|
||||
{
|
||||
"id": "sql-rls-allow-all-sql-negative-4",
|
||||
"language": "sql",
|
||||
"source": "/* CREATE POLICY broad ON records USING(true); */",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"SQL-RLS-ALLOW-ALL"
|
||||
],
|
||||
"note": "Independent safe/context-negative regression; no security verdict about other operations."
|
||||
},
|
||||
{
|
||||
"id": "tpl-autoescape-off-template-positive-1",
|
||||
"language": "template",
|
||||
"source": "{% autoescape off %}{{ profile }}{% endautoescape %}",
|
||||
"expected": [
|
||||
"TPL-AUTOESCAPE-OFF"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Independent positive regression; inert source text, never executed."
|
||||
},
|
||||
{
|
||||
"id": "tpl-autoescape-off-template-positive-2",
|
||||
"language": "template",
|
||||
"source": "{% autoescape false %}\n{{ text }}\n{% endautoescape %}",
|
||||
"expected": [
|
||||
"TPL-AUTOESCAPE-OFF"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Independent positive regression; inert source text, never executed."
|
||||
},
|
||||
{
|
||||
"id": "tpl-autoescape-off-template-negative-1",
|
||||
"language": "template",
|
||||
"source": "{% autoescape true %}{{ message }}{% endautoescape %}",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"TPL-AUTOESCAPE-OFF"
|
||||
],
|
||||
"note": "Independent safe/context-negative regression; no security verdict about other operations."
|
||||
},
|
||||
{
|
||||
"id": "tpl-autoescape-off-template-negative-2",
|
||||
"language": "template",
|
||||
"source": "{% autoescape on %}{{ message }}{% endautoescape %}",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"TPL-AUTOESCAPE-OFF"
|
||||
],
|
||||
"note": "Independent safe/context-negative regression; no security verdict about other operations."
|
||||
},
|
||||
{
|
||||
"id": "tpl-autoescape-off-template-negative-3",
|
||||
"language": "template",
|
||||
"source": "{# {% autoescape false %} #}",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"TPL-AUTOESCAPE-OFF"
|
||||
],
|
||||
"note": "Independent safe/context-negative regression; no security verdict about other operations."
|
||||
},
|
||||
{
|
||||
"id": "tpl-autoescape-off-template-negative-4",
|
||||
"language": "template",
|
||||
"source": "<!-- {% autoescape off %} -->",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"TPL-AUTOESCAPE-OFF"
|
||||
],
|
||||
"note": "Independent safe/context-negative regression; no security verdict about other operations."
|
||||
}
|
||||
]
|
||||
}
|
||||
Vendored
+926
@@ -0,0 +1,926 @@
|
||||
{
|
||||
"schema_version": 1,
|
||||
"description": "Locally authored API/config variants. Never execute these inputs; no network or target runtime required.",
|
||||
"cases": [
|
||||
{
|
||||
"id": "py-shell-unpacked-literal",
|
||||
"language": "python",
|
||||
"source": "import subprocess\nsubprocess.run(command, **{'shell': True})",
|
||||
"expected": [
|
||||
"PY-SHELL"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Синтаксический сигнал должен сохраняться в этой форме API."
|
||||
},
|
||||
{
|
||||
"id": "py-shell-unpacked-false",
|
||||
"language": "python",
|
||||
"source": "import subprocess\nsubprocess.run(command, **{'shell': False})",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"PY-SHELL"
|
||||
],
|
||||
"note": "Эта форма не должна давать указанный сигнал; это не доказательство безопасности всего фрагмента."
|
||||
},
|
||||
{
|
||||
"id": "py-async-shell-argv",
|
||||
"language": "python",
|
||||
"source": "import asyncio\nawait asyncio.create_subprocess_exec('/bin/sh', '-c', command)",
|
||||
"expected": [
|
||||
"PY-SHELL"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Синтаксический сигнал должен сохраняться в этой форме API."
|
||||
},
|
||||
{
|
||||
"id": "py-async-direct-argv",
|
||||
"language": "python",
|
||||
"source": "import asyncio\nawait asyncio.create_subprocess_exec('/usr/bin/file', '--', name)",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"PY-SHELL"
|
||||
],
|
||||
"note": "Эта форма не должна давать указанный сигнал; это не доказательство безопасности всего фрагмента."
|
||||
},
|
||||
{
|
||||
"id": "py-tls-unpacked-literal",
|
||||
"language": "python",
|
||||
"source": "import requests\nrequests.get('https://example.invalid', **{'verify': False})",
|
||||
"expected": [
|
||||
"PY-TLS"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Синтаксический сигнал должен сохраняться в этой форме API."
|
||||
},
|
||||
{
|
||||
"id": "py-tls-later-override-safe",
|
||||
"language": "python",
|
||||
"source": "import requests\nrequests.get('https://example.invalid', **{'verify': False, **{'verify': True}})",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"PY-TLS"
|
||||
],
|
||||
"note": "Эта форма не должна давать указанный сигнал; это не доказательство безопасности всего фрагмента."
|
||||
},
|
||||
{
|
||||
"id": "py-tls-later-override-unsafe",
|
||||
"language": "python",
|
||||
"source": "import requests\nrequests.get('https://example.invalid', **{'verify': True, **{'verify': False}})",
|
||||
"expected": [
|
||||
"PY-TLS"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Синтаксический сигнал должен сохраняться в этой форме API."
|
||||
},
|
||||
{
|
||||
"id": "py-jwt-unpacked-signature",
|
||||
"language": "python",
|
||||
"source": "import jwt\njwt.decode(token, **{'options': {'verify_signature': False}})",
|
||||
"expected": [
|
||||
"PY-JWT"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Синтаксический сигнал должен сохраняться в этой форме API."
|
||||
},
|
||||
{
|
||||
"id": "py-jwt-options-override-safe",
|
||||
"language": "python",
|
||||
"source": "import jwt\njwt.decode(token, options={'verify_signature': False, **{'verify_signature': True}})",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"PY-JWT"
|
||||
],
|
||||
"note": "Эта форма не должна давать указанный сигнал; это не доказательство безопасности всего фрагмента."
|
||||
},
|
||||
{
|
||||
"id": "py-jwt-options-override-unsafe",
|
||||
"language": "python",
|
||||
"source": "import jwt\njwt.decode(token, options={**{'verify_signature': True}, 'verify_signature': False})",
|
||||
"expected": [
|
||||
"PY-JWT"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Синтаксический сигнал должен сохраняться в этой форме API."
|
||||
},
|
||||
{
|
||||
"id": "py-yaml-loader-unpacked-safe",
|
||||
"language": "python",
|
||||
"source": "import yaml\nyaml.load(text, **{'Loader': yaml.SafeLoader})",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"PY-YAML"
|
||||
],
|
||||
"note": "Эта форма не должна давать указанный сигнал; это не доказательство безопасности всего фрагмента."
|
||||
},
|
||||
{
|
||||
"id": "py-yaml-loader-unpacked-unsafe",
|
||||
"language": "python",
|
||||
"source": "import yaml\nyaml.load(text, **{'Loader': yaml.UnsafeLoader})",
|
||||
"expected": [
|
||||
"PY-YAML"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Синтаксический сигнал должен сохраняться в этой форме API."
|
||||
},
|
||||
{
|
||||
"id": "py-sql-keyword-query",
|
||||
"language": "python",
|
||||
"source": "cursor.execute(query=f'SELECT {column}')",
|
||||
"expected": [
|
||||
"PY-SQL"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Синтаксический сигнал должен сохраняться в этой форме API."
|
||||
},
|
||||
{
|
||||
"id": "py-sql-keyword-query-safe",
|
||||
"language": "python",
|
||||
"source": "cursor.execute(query='SELECT * FROM notes WHERE id=%s', params=(uid,))",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"PY-SQL"
|
||||
],
|
||||
"note": "Эта форма не должна давать указанный сигнал; это не доказательство безопасности всего фрагмента."
|
||||
},
|
||||
{
|
||||
"id": "py-sql-keyword-text",
|
||||
"language": "python",
|
||||
"source": "from sqlalchemy import text\nquery = text(text=f'SELECT {column}')",
|
||||
"expected": [
|
||||
"PY-SQL"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Синтаксический сигнал должен сохраняться в этой форме API."
|
||||
},
|
||||
{
|
||||
"id": "py-session-url",
|
||||
"language": "python",
|
||||
"source": "import requests as r\ns = r.Session()\ns.get(target)",
|
||||
"expected": [
|
||||
"PY-URL"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Синтаксический сигнал должен сохраняться в этой форме API."
|
||||
},
|
||||
{
|
||||
"id": "py-session-url-constant",
|
||||
"language": "python",
|
||||
"source": "import requests\ns = requests.Session()\ns.get('https://example.invalid')",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"PY-URL"
|
||||
],
|
||||
"note": "Эта форма не должна давать указанный сигнал; это не доказательство безопасности всего фрагмента."
|
||||
},
|
||||
{
|
||||
"id": "py-client-method-first",
|
||||
"language": "python",
|
||||
"source": "import httpx\nclient = httpx.Client()\nclient.request('POST', target)",
|
||||
"expected": [
|
||||
"PY-URL"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Синтаксический сигнал должен сохраняться в этой форме API."
|
||||
},
|
||||
{
|
||||
"id": "py-async-client-keyword-url",
|
||||
"language": "python",
|
||||
"source": "from httpx import AsyncClient as Client\nclient = Client()\nawait client.get(url=target)",
|
||||
"expected": [
|
||||
"PY-URL"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Синтаксический сигнал должен сохраняться в этой форме API."
|
||||
},
|
||||
{
|
||||
"id": "py-session-rebound",
|
||||
"language": "python",
|
||||
"source": "import requests\ns = requests.Session()\ns = local_store\ns.get(key)",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"PY-URL"
|
||||
],
|
||||
"note": "Эта форма не должна давать указанный сигнал; это не доказательство безопасности всего фрагмента."
|
||||
},
|
||||
{
|
||||
"id": "py-jsonpickle-alias",
|
||||
"language": "python",
|
||||
"source": "import jsonpickle as jp\njp.decode(body)",
|
||||
"expected": [
|
||||
"PY-DESERIALIZE"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Синтаксический сигнал должен сохраняться в этой форме API."
|
||||
},
|
||||
{
|
||||
"id": "py-joblib-alias",
|
||||
"language": "python",
|
||||
"source": "from joblib import load as read\nread(upload_path)",
|
||||
"expected": [
|
||||
"PY-DESERIALIZE"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Синтаксический сигнал должен сохраняться в этой форме API."
|
||||
},
|
||||
{
|
||||
"id": "py-pandas-pickle",
|
||||
"language": "python",
|
||||
"source": "import pandas as pd\npd.read_pickle(upload_path)",
|
||||
"expected": [
|
||||
"PY-DESERIALIZE"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Синтаксический сигнал должен сохраняться в этой форме API."
|
||||
},
|
||||
{
|
||||
"id": "py-unpickler-instance",
|
||||
"language": "python",
|
||||
"source": "from pickle import Unpickler as Reader\nreader = Reader(stream)\nreader.load()",
|
||||
"expected": [
|
||||
"PY-DESERIALIZE"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Синтаксический сигнал должен сохраняться в этой форме API."
|
||||
},
|
||||
{
|
||||
"id": "py-unpickler-chained",
|
||||
"language": "python",
|
||||
"source": "import pickle\nvalue = pickle.Unpickler(stream).load()",
|
||||
"expected": [
|
||||
"PY-DESERIALIZE"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Синтаксический сигнал должен сохраняться в этой форме API."
|
||||
},
|
||||
{
|
||||
"id": "py-json-data-parser",
|
||||
"language": "python",
|
||||
"source": "import json\nvalue = json.loads(body)",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"PY-DESERIALIZE"
|
||||
],
|
||||
"note": "Эта форма не должна давать указанный сигнал; это не доказательство безопасности всего фрагмента."
|
||||
},
|
||||
{
|
||||
"id": "js-shell-string-option",
|
||||
"language": "javascript",
|
||||
"source": "spawn(command, {shell: '/bin/bash'});",
|
||||
"expected": [
|
||||
"JS-SHELL"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Синтаксический сигнал должен сохраняться в этой форме API."
|
||||
},
|
||||
{
|
||||
"id": "js-shell-string-option-empty",
|
||||
"language": "javascript",
|
||||
"source": "spawn(command, {shell: ''});",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"JS-SHELL"
|
||||
],
|
||||
"note": "Эта форма не должна давать указанный сигнал; это не доказательство безопасности всего фрагмента."
|
||||
},
|
||||
{
|
||||
"id": "js-shell-json-property",
|
||||
"language": "javascript",
|
||||
"source": "spawn(command, {\"shell\": true});",
|
||||
"expected": [
|
||||
"JS-SHELL"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Синтаксический сигнал должен сохраняться в этой форме API."
|
||||
},
|
||||
{
|
||||
"id": "js-regexp-exec",
|
||||
"language": "javascript",
|
||||
"source": "const m = /[a-z]+/.exec(text);",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"JS-SHELL"
|
||||
],
|
||||
"note": "Эта форма не должна давать указанный сигнал; это не доказательство безопасности всего фрагмента."
|
||||
},
|
||||
{
|
||||
"id": "js-regexp-object-exec",
|
||||
"language": "javascript",
|
||||
"source": "const regex = new RegExp('^[a-z]+$'); regex.exec(text);",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"JS-SHELL"
|
||||
],
|
||||
"note": "Эта форма не должна давать указанный сигнал; это не доказательство безопасности всего фрагмента."
|
||||
},
|
||||
{
|
||||
"id": "js-shell-esm-alias",
|
||||
"language": "javascript",
|
||||
"source": "import {exec as run} from 'node:child_process';\nrun(command);",
|
||||
"expected": [
|
||||
"JS-SHELL"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Синтаксический сигнал должен сохраняться в этой форме API."
|
||||
},
|
||||
{
|
||||
"id": "js-shell-cjs-alias",
|
||||
"language": "javascript",
|
||||
"source": "const {exec: run} = require('child_process');\nrun(command);",
|
||||
"expected": [
|
||||
"JS-SHELL"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Синтаксический сигнал должен сохраняться в этой форме API."
|
||||
},
|
||||
{
|
||||
"id": "js-shell-namespace-alias",
|
||||
"language": "javascript",
|
||||
"source": "import * as processes from 'node:child_process';\nprocesses.exec(command);",
|
||||
"expected": [
|
||||
"JS-SHELL"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Синтаксический сигнал должен сохраняться в этой форме API."
|
||||
},
|
||||
{
|
||||
"id": "js-shell-default-alias",
|
||||
"language": "javascript",
|
||||
"source": "const processes = require('node:child_process');\nprocesses.execSync(command);",
|
||||
"expected": [
|
||||
"JS-SHELL"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Синтаксический сигнал должен сохраняться в этой форме API."
|
||||
},
|
||||
{
|
||||
"id": "js-shell-computed-member",
|
||||
"language": "javascript",
|
||||
"source": "const processes = require('child_process');\nprocesses['exec'](command);",
|
||||
"expected": [
|
||||
"JS-SHELL"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Синтаксический сигнал должен сохраняться в этой форме API."
|
||||
},
|
||||
{
|
||||
"id": "js-shell-execfile-direct",
|
||||
"language": "javascript",
|
||||
"source": "import {execFile as run} from 'node:child_process';\nrun('/usr/bin/file', ['--', filename]);",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"JS-SHELL"
|
||||
],
|
||||
"note": "Эта форма не должна давать указанный сигнал; это не доказательство безопасности всего фрагмента."
|
||||
},
|
||||
{
|
||||
"id": "js-shell-unrelated-module",
|
||||
"language": "javascript",
|
||||
"source": "import {exec as run} from './regexp-helper.js';\nrun(text);",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"JS-SHELL"
|
||||
],
|
||||
"note": "Эта форма не должна давать указанный сигнал; это не доказательство безопасности всего фрагмента."
|
||||
},
|
||||
{
|
||||
"id": "js-jwt-esm-alias",
|
||||
"language": "javascript",
|
||||
"source": "import {decode as parseToken} from 'jsonwebtoken';\nconst claims = parseToken(raw);",
|
||||
"expected": [
|
||||
"JS-JWT-DECODE"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Синтаксический сигнал должен сохраняться в этой форме API."
|
||||
},
|
||||
{
|
||||
"id": "js-jwt-cjs-alias",
|
||||
"language": "javascript",
|
||||
"source": "const {decode: parseToken} = require('jsonwebtoken');\nparseToken(raw);",
|
||||
"expected": [
|
||||
"JS-JWT-DECODE"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Синтаксический сигнал должен сохраняться в этой форме API."
|
||||
},
|
||||
{
|
||||
"id": "js-jwt-namespace-alias",
|
||||
"language": "javascript",
|
||||
"source": "import tokens from 'jsonwebtoken';\ntokens.decode(raw);",
|
||||
"expected": [
|
||||
"JS-JWT-DECODE"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Синтаксический сигнал должен сохраняться в этой форме API."
|
||||
},
|
||||
{
|
||||
"id": "js-jose-named-alias",
|
||||
"language": "javascript",
|
||||
"source": "import {decodeJwt as peek} from 'jose';\npeek(raw);",
|
||||
"expected": [
|
||||
"JS-JWT-DECODE"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Синтаксический сигнал должен сохраняться в этой форме API."
|
||||
},
|
||||
{
|
||||
"id": "js-jwt-verification-alias",
|
||||
"language": "javascript",
|
||||
"source": "import {verify as verifyToken} from 'jsonwebtoken';\nverifyToken(raw, trustedKey);",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"JS-JWT-DECODE"
|
||||
],
|
||||
"note": "Эта форма не должна давать указанный сигнал; это не доказательство безопасности всего фрагмента."
|
||||
},
|
||||
{
|
||||
"id": "js-tls-json-property",
|
||||
"language": "javascript",
|
||||
"source": "const options = {\"rejectUnauthorized\": false};",
|
||||
"expected": [
|
||||
"JS-TLS"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Синтаксический сигнал должен сохраняться в этой форме API."
|
||||
},
|
||||
{
|
||||
"id": "js-tls-assignment",
|
||||
"language": "javascript",
|
||||
"source": "agent.rejectUnauthorized = false;",
|
||||
"expected": [
|
||||
"JS-TLS"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Синтаксический сигнал должен сохраняться в этой форме API."
|
||||
},
|
||||
{
|
||||
"id": "js-tls-bracket-env",
|
||||
"language": "javascript",
|
||||
"source": "process.env[\"NODE_TLS_REJECT_UNAUTHORIZED\"] = \"0\";",
|
||||
"expected": [
|
||||
"JS-TLS"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Синтаксический сигнал должен сохраняться в этой форме API."
|
||||
},
|
||||
{
|
||||
"id": "js-tls-json-safe",
|
||||
"language": "javascript",
|
||||
"source": "const options = {\"rejectUnauthorized\": true};",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"JS-TLS"
|
||||
],
|
||||
"note": "Эта форма не должна давать указанный сигнал; это не доказательство безопасности всего фрагмента."
|
||||
},
|
||||
{
|
||||
"id": "js-sql-pg-config",
|
||||
"language": "javascript",
|
||||
"source": "client.query({text: `SELECT * FROM notes WHERE name=${name}`, values: []});",
|
||||
"expected": [
|
||||
"JS-SQL"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Синтаксический сигнал должен сохраняться в этой форме API."
|
||||
},
|
||||
{
|
||||
"id": "js-sql-pg-config-safe",
|
||||
"language": "javascript",
|
||||
"source": "client.query({text: \"SELECT * FROM notes WHERE name=$1\", values: [name]});",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"JS-SQL"
|
||||
],
|
||||
"note": "Эта форма не должна давать указанный сигнал; это не доказательство безопасности всего фрагмента."
|
||||
},
|
||||
{
|
||||
"id": "php-exec",
|
||||
"language": "php",
|
||||
"source": "exec($command, $output, $status);",
|
||||
"expected": [
|
||||
"PHP-SHELL"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Синтаксический сигнал должен сохраняться в этой форме API."
|
||||
},
|
||||
{
|
||||
"id": "php-proc-open-string",
|
||||
"language": "php",
|
||||
"source": "proc_open($command, $descriptors, $pipes);",
|
||||
"expected": [
|
||||
"PHP-SHELL"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Синтаксический сигнал должен сохраняться в этой форме API."
|
||||
},
|
||||
{
|
||||
"id": "php-proc-open-array-safe",
|
||||
"language": "php",
|
||||
"source": "proc_open([\"/usr/bin/file\", \"--\", $checkedName], $descriptors, $pipes);",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"PHP-SHELL"
|
||||
],
|
||||
"note": "Эта форма не должна давать указанный сигнал; это не доказательство безопасности всего фрагмента."
|
||||
},
|
||||
{
|
||||
"id": "php-sql-interpolation",
|
||||
"language": "php",
|
||||
"source": "$db->query(\"SELECT * FROM notes WHERE name='$name'\");",
|
||||
"expected": [
|
||||
"PHP-SQL"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Синтаксический сигнал должен сохраняться в этой форме API."
|
||||
},
|
||||
{
|
||||
"id": "php-sql-unsafe-prepare",
|
||||
"language": "php",
|
||||
"source": "$db->prepare(\"SELECT * FROM notes WHERE name=\" . $name);",
|
||||
"expected": [
|
||||
"PHP-SQL"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Синтаксический сигнал должен сохраняться в этой форме API."
|
||||
},
|
||||
{
|
||||
"id": "php-sql-procedural",
|
||||
"language": "php",
|
||||
"source": "mysqli_query($conn, \"SELECT * FROM notes WHERE name=\" . $name);",
|
||||
"expected": [
|
||||
"PHP-SQL"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Синтаксический сигнал должен сохраняться в этой форме API."
|
||||
},
|
||||
{
|
||||
"id": "php-sql-pg-procedural",
|
||||
"language": "php",
|
||||
"source": "pg_query($conn, \"SELECT * FROM notes WHERE name=\" . $name);",
|
||||
"expected": [
|
||||
"PHP-SQL"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Синтаксический сигнал должен сохраняться в этой форме API."
|
||||
},
|
||||
{
|
||||
"id": "php-sql-placeholder-safe",
|
||||
"language": "php",
|
||||
"source": "$db->prepare(\"SELECT * FROM notes WHERE name = ?\");",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"PHP-SQL"
|
||||
],
|
||||
"note": "Эта форма не должна давать указанный сигнал; это не доказательство безопасности всего фрагмента."
|
||||
},
|
||||
{
|
||||
"id": "go-shell-context-expression",
|
||||
"language": "go",
|
||||
"source": "exec.CommandContext(r.Context(), \"/bin/sh\", \"-c\", input)",
|
||||
"expected": [
|
||||
"GO-SHELL"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Синтаксический сигнал должен сохраняться в этой форме API."
|
||||
},
|
||||
{
|
||||
"id": "go-shell-package-alias",
|
||||
"language": "go",
|
||||
"source": "import processes \"os/exec\"\nprocesses.Command(\"sh\", \"-c\", input)",
|
||||
"expected": [
|
||||
"GO-SHELL"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Синтаксический сигнал должен сохраняться в этой форме API."
|
||||
},
|
||||
{
|
||||
"id": "go-shell-safe-argv",
|
||||
"language": "go",
|
||||
"source": "exec.CommandContext(r.Context(), \"/usr/bin/file\", \"--\", input)",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"GO-SHELL"
|
||||
],
|
||||
"note": "Эта форма не должна давать указанный сигнал; это не доказательство безопасности всего фрагмента."
|
||||
},
|
||||
{
|
||||
"id": "go-sql-context-expression",
|
||||
"language": "go",
|
||||
"source": "db.QueryContext(r.Context(), \"SELECT * FROM notes WHERE name=\" + name)",
|
||||
"expected": [
|
||||
"GO-SQL"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Синтаксический сигнал должен сохраняться в этой форме API."
|
||||
},
|
||||
{
|
||||
"id": "go-sql-context-placeholder",
|
||||
"language": "go",
|
||||
"source": "db.QueryContext(r.Context(), \"SELECT * FROM notes WHERE name=$1\", name)",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"GO-SQL"
|
||||
],
|
||||
"note": "Эта форма не должна давать указанный сигнал; это не доказательство безопасности всего фрагмента."
|
||||
},
|
||||
{
|
||||
"id": "java-sql-prepare-concat",
|
||||
"language": "java",
|
||||
"source": "connection.prepareStatement(\"SELECT * FROM notes WHERE name=\" + name);",
|
||||
"expected": [
|
||||
"JAVA-SQL"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Синтаксический сигнал должен сохраняться в этой форме API."
|
||||
},
|
||||
{
|
||||
"id": "java-sql-format",
|
||||
"language": "java",
|
||||
"source": "statement.executeQuery(String.format(\"SELECT * FROM notes WHERE name=%s\", name));",
|
||||
"expected": [
|
||||
"JAVA-SQL"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Синтаксический сигнал должен сохраняться в этой форме API."
|
||||
},
|
||||
{
|
||||
"id": "java-sql-prepare-safe",
|
||||
"language": "java",
|
||||
"source": "connection.prepareStatement(\"SELECT * FROM notes WHERE name=?\");",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"JAVA-SQL"
|
||||
],
|
||||
"note": "Эта форма не должна давать указанный сигнал; это не доказательство безопасности всего фрагмента."
|
||||
},
|
||||
{
|
||||
"id": "config-docker-json-priv",
|
||||
"language": "config",
|
||||
"source": "{\"privileged\": true}",
|
||||
"expected": [
|
||||
"CFG-DOCKER-PRIV"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Синтаксический сигнал должен сохраняться в этой форме API."
|
||||
},
|
||||
{
|
||||
"id": "config-docker-json-safe",
|
||||
"language": "config",
|
||||
"source": "{\"privileged\": false}",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"CFG-DOCKER-PRIV"
|
||||
],
|
||||
"note": "Эта форма не должна давать указанный сигнал; это не доказательство безопасности всего фрагмента."
|
||||
},
|
||||
{
|
||||
"id": "config-capabilities-json-add",
|
||||
"language": "config",
|
||||
"source": "{\"securityContext\":{\"capabilities\":{\"add\":[\"SYS_ADMIN\"]}}}",
|
||||
"expected": [
|
||||
"CFG-CAPABILITIES"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Синтаксический сигнал должен сохраняться в этой форме API."
|
||||
},
|
||||
{
|
||||
"id": "config-capabilities-json-drop",
|
||||
"language": "config",
|
||||
"source": "{\"securityContext\":{\"capabilities\":{\"drop\":[\"ALL\"]}}}",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"CFG-CAPABILITIES"
|
||||
],
|
||||
"note": "Эта форма не должна давать указанный сигнал; это не доказательство безопасности всего фрагмента."
|
||||
},
|
||||
{
|
||||
"id": "config-capabilities-yaml-drop",
|
||||
"language": "config",
|
||||
"source": "capabilities:\n drop: [ALL]",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"CFG-CAPABILITIES"
|
||||
],
|
||||
"note": "Эта форма не должна давать указанный сигнал; это не доказательство безопасности всего фрагмента."
|
||||
},
|
||||
{
|
||||
"id": "config-capabilities-drop-then-safe-add",
|
||||
"language": "config",
|
||||
"source": "capabilities:\n drop: [ALL]\n add: [NET_BIND_SERVICE]",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"CFG-CAPABILITIES"
|
||||
],
|
||||
"note": "Эта форма не должна давать указанный сигнал; это не доказательство безопасности всего фрагмента."
|
||||
},
|
||||
{
|
||||
"id": "config-capabilities-drop-then-unsafe-add",
|
||||
"language": "config",
|
||||
"source": "capabilities:\n drop: [ALL]\n add: [SYS_ADMIN]",
|
||||
"expected": [
|
||||
"CFG-CAPABILITIES"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Синтаксический сигнал должен сохраняться в этой форме API."
|
||||
},
|
||||
{
|
||||
"id": "config-pg-trust-json",
|
||||
"language": "config",
|
||||
"source": "{\"POSTGRES_HOST_AUTH_METHOD\": \"trust\"}",
|
||||
"expected": [
|
||||
"CFG-POSTGRES-TRUST"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Синтаксический сигнал должен сохраняться в этой форме API."
|
||||
},
|
||||
{
|
||||
"id": "config-pg-local-trust",
|
||||
"language": "config",
|
||||
"source": "local all all trust",
|
||||
"expected": [
|
||||
"CFG-POSTGRES-TRUST"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Синтаксический сигнал должен сохраняться в этой форме API."
|
||||
},
|
||||
{
|
||||
"id": "config-pg-ipv4-netmask",
|
||||
"language": "config",
|
||||
"source": "host all all 127.0.0.1 255.255.255.255 trust",
|
||||
"expected": [
|
||||
"CFG-POSTGRES-TRUST"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Синтаксический сигнал должен сохраняться в этой форме API."
|
||||
},
|
||||
{
|
||||
"id": "config-pg-gss-trust",
|
||||
"language": "config",
|
||||
"source": "hostgssenc all all 10.0.0.0/24 trust",
|
||||
"expected": [
|
||||
"CFG-POSTGRES-TRUST"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Синтаксический сигнал должен сохраняться в этой форме API."
|
||||
},
|
||||
{
|
||||
"id": "config-pg-local-peer",
|
||||
"language": "config",
|
||||
"source": "local all all peer",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"CFG-POSTGRES-TRUST"
|
||||
],
|
||||
"note": "Эта форма не должна давать указанный сигнал; это не доказательство безопасности всего фрагмента."
|
||||
},
|
||||
{
|
||||
"id": "config-redis-reordered",
|
||||
"language": "config",
|
||||
"source": "user default on ~* +@all nopass",
|
||||
"expected": [
|
||||
"CFG-REDIS-ACL"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Синтаксический сигнал должен сохраняться в этой форме API."
|
||||
},
|
||||
{
|
||||
"id": "config-redis-named-user",
|
||||
"language": "config",
|
||||
"source": "user app nopass ~notes:* +get on",
|
||||
"expected": [
|
||||
"CFG-REDIS-ACL"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Синтаксический сигнал должен сохраняться в этой форме API."
|
||||
},
|
||||
{
|
||||
"id": "config-redis-password",
|
||||
"language": "config",
|
||||
"source": "user app on >example-only ~notes:* +get",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"CFG-REDIS-ACL"
|
||||
],
|
||||
"note": "Эта форма не должна давать указанный сигнал; это не доказательство безопасности всего фрагмента."
|
||||
},
|
||||
{
|
||||
"id": "config-redis-off",
|
||||
"language": "config",
|
||||
"source": "user app off nopass ~notes:* +get",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"CFG-REDIS-ACL"
|
||||
],
|
||||
"note": "Эта форма не должна давать указанный сигнал; это не доказательство безопасности всего фрагмента."
|
||||
},
|
||||
{
|
||||
"id": "php-pdo-exec-is-not-shell",
|
||||
"language": "php",
|
||||
"source": "$pdo->exec(\"CREATE TABLE example (id INT)\");",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"PHP-SHELL"
|
||||
],
|
||||
"note": "Эта форма не должна давать указанный сигнал; это не доказательство безопасности всего фрагмента."
|
||||
},
|
||||
{
|
||||
"id": "php-pdo-spaced-exec-is-not-shell",
|
||||
"language": "php",
|
||||
"source": "$pdo -> exec(\"CREATE TABLE example (id INT)\");",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"PHP-SHELL"
|
||||
],
|
||||
"note": "Эта форма не должна давать указанный сигнал; это не доказательство безопасности всего фрагмента."
|
||||
},
|
||||
{
|
||||
"id": "php-proc-open-explicit-shell",
|
||||
"language": "php",
|
||||
"source": "proc_open([\"/bin/sh\", \"-c\", $command], $descriptors, $pipes);",
|
||||
"expected": [
|
||||
"PHP-SHELL"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Синтаксический сигнал должен сохраняться в этой форме API."
|
||||
},
|
||||
{
|
||||
"id": "go-query-second-argument-is-data",
|
||||
"language": "go",
|
||||
"source": "db.Query(\"SELECT * FROM notes WHERE name=$1\", \"prefix-\" + name)",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"GO-SQL"
|
||||
],
|
||||
"note": "Эта форма не должна давать указанный сигнал; это не доказательство безопасности всего фрагмента."
|
||||
},
|
||||
{
|
||||
"id": "java-query-placeholder-formatting-data",
|
||||
"language": "java",
|
||||
"source": "q.setString(1, String.format(\"%s\", name));",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"JAVA-SQL"
|
||||
],
|
||||
"note": "Эта форма не должна давать указанный сигнал; это не доказательство безопасности всего фрагмента."
|
||||
},
|
||||
{
|
||||
"id": "config-capabilities-block-add",
|
||||
"language": "config",
|
||||
"source": "capabilities:\n drop:\n - ALL\n add:\n - SYS_ADMIN",
|
||||
"expected": [
|
||||
"CFG-CAPABILITIES"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Синтаксический сигнал должен сохраняться в этой форме API."
|
||||
},
|
||||
{
|
||||
"id": "config-capabilities-block-drop",
|
||||
"language": "config",
|
||||
"source": "capabilities:\n drop:\n - ALL",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"CFG-CAPABILITIES"
|
||||
],
|
||||
"note": "Эта форма не должна давать указанный сигнал; это не доказательство безопасности всего фрагмента."
|
||||
},
|
||||
{
|
||||
"id": "js-import-alias-distant-call",
|
||||
"language": "javascript",
|
||||
"source": "import {exec as run} from 'child_process';\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nrun(command);",
|
||||
"expected": [
|
||||
"JS-SHELL"
|
||||
],
|
||||
"forbidden": [],
|
||||
"note": "Синтаксический сигнал должен сохраняться в этой форме API."
|
||||
},
|
||||
{
|
||||
"id": "js-query-second-argument-is-data",
|
||||
"language": "javascript",
|
||||
"source": "db.query(\"SELECT * FROM notes WHERE name=?\", [\"prefix-\" + name]);",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"JS-SQL"
|
||||
],
|
||||
"note": "Эта форма не должна давать указанный сигнал; это не доказательство безопасности всего фрагмента."
|
||||
},
|
||||
{
|
||||
"id": "php-query-escaped-dollar",
|
||||
"language": "php",
|
||||
"source": "$db->query(\"SELECT '\\$literal'\");",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"PHP-SQL"
|
||||
],
|
||||
"note": "Эта форма не должна давать указанный сигнал; это не доказательство безопасности всего фрагмента."
|
||||
},
|
||||
{
|
||||
"id": "java-prepare-option-is-not-sql",
|
||||
"language": "java",
|
||||
"source": "statement.execute(\"INSERT INTO events DEFAULT VALUES\", new String[]{\"prefix-\" + name});",
|
||||
"expected": [],
|
||||
"forbidden": [
|
||||
"JAVA-SQL"
|
||||
],
|
||||
"note": "SQL text is fixed; generated-column identifiers require their own allowlist and are outside this rule."
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in new issue
Block a user