diff --git a/corgea_semgrep_456405e1-950e-491e-b0ce-3db590336603_report.json b/corgea_semgrep_456405e1-950e-491e-b0ce-3db590336603_report.json new file mode 100644 index 0000000..7218c9d --- /dev/null +++ b/corgea_semgrep_456405e1-950e-491e-b0ce-3db590336603_report.json @@ -0,0 +1 @@ +{"version":"1.99.0","results":[{"check_id":"generic.secrets.security.detected-aws-access-key-id-value.detected-aws-access-key-id-value","path":"corgea_semgrep_a2b6205a-1433-4fe9-bc40-009e100c1608_report.json","start":{"line":1,"col":13022,"offset":13021},"end":{"line":1,"col":13042,"offset":13041},"extra":{"metavars":{"$1":{"start":{"line":1,"col":13022,"offset":13021},"end":{"line":1,"col":13026,"offset":13025},"abstract_content":"AKIA"}},"message":"AWS Access Key ID Value detected. This is a sensitive credential and should not be hardcoded here. Instead, read this value from an environment variable or keep it in a separate, private file.","metadata":{"cwe":["CWE-798: Use of Hard-coded Credentials"],"source-rule-url":"https://github.com/grab/secret-scanner/blob/master/scanner/signatures/pattern.go","category":"security","technology":["secrets","aws"],"confidence":"LOW","owasp":["A07:2021 - Identification and Authentication Failures"],"references":["https://owasp.org/Top10/A07_2021-Identification_and_Authentication_Failures"],"cwe2022-top25":true,"cwe2021-top25":true,"subcategory":["audit"],"likelihood":"LOW","impact":"HIGH","license":"Semgrep Rules License v1.0. For more details, visit semgrep.dev/legal/rules-license","vulnerability_class":["Hard-coded Secrets"],"source":"https://semgrep.dev/r/generic.secrets.security.detected-aws-access-key-id-value.detected-aws-access-key-id-value","shortlink":"https://sg.run/GeD1","semgrep.dev":{"rule":{"origin":"community","r_id":9048,"rule_id":"oqUevO","rv_id":945484,"url":"https://semgrep.dev/playground/r/rxT6rnL/generic.secrets.security.detected-aws-access-key-id-value.detected-aws-access-key-id-value","version_id":"rxT6rnL"}}},"severity":"ERROR","fingerprint":"a92fa2e9e521b09866cf96d2a571ceada4ff6b6852d2d3e857de4e6d1bddbf761c6a2d7ccf1f5954b6c39ed628c17124cdbb36b65c9cb3547234df698b4f79e3_0","lines":"{\"version\":\"1.99.0\",\"results\":[{\"check_id\":\"dockerfile.security.missing-user.missing-user\",\"path\":\"insecure-api/Dockerfile\",\"start\":{\"line\":21,\"col\":1,\"offset\":515},\"end\":{\"line\":21,\"col\":67,\"offset\":581},\"extra\":{\"metavars\":{\"$...VARS\":{\"start\":{\"line\":21,\"col\":5,\"offset\":519},\"end\":{\"line\":21,\"col\":67,\"offset\":581},\"abstract_content\":\"[\\\"uvicorn\\\"\\\"main:app\\\"\\\"--host\\\"\\\"0.0.0.0\\\"\\\"--port\\\"\\\"8000\\\"]\"}},\"message\":\"By not specifying a USER, a program in the container may run as 'root'. This is a security hazard. If an attacker can control a process running as root, they may have control over the container. Ensure that the last USER in a Dockerfile is a USER other than 'root'.\",\"fix\":\"USER non-root\\nCMD [\\\"uvicorn\\\", \\\"main:app\\\", \\\"--host\\\", \\\"0.0.0.0\\\", \\\"--port\\\", \\\"8000\\\"]\",\"metadata\":{\"cwe\":[\"CWE-269: Improper Privilege Management\"],\"category\":\"security\",\"technology\":[\"dockerfile\"],\"confidence\":\"MEDIUM\",\"owasp\":[\"A04:2021 - Insecure Design\"],\"references\":[\"https://owasp.org/Top10/A04_2021-Insecure_Design\"],\"subcategory\":[\"audit\"],\"likelihood\":\"LOW\",\"impact\":\"MEDIUM\",\"license\":\"Semgrep Rules License v1.0. For more details, visit semgrep.dev/legal/rules-license\",\"vulnerability_class\":[\"Improper Authorization\"],\"source\":\"https://semgrep.dev/r/dockerfile.security.missing-user.missing-user\",\"shortlink\":\"https://sg.run/Gbvn\",\"semgrep.dev\":{\"rule\":{\"origin\":\"community\",\"r_id\":20148,\"rule_id\":\"AbUN06\",\"rv_id\":945269,\"url\":\"https://semgrep.dev/playground/r/qkT4j4L/dockerfile.security.missing-user.missing-user\",\"version_id\":\"qkT4j4L\"}}},\"severity\":\"ERROR\",\"fingerprint\":\"25f3812a6390e38eca84b059a4836996e8a499976b2733ecfc3a15af0e3ab8a06edab7651035844e2cbce09e1a8b7b31970a2d7c3e4bc873153beabc64fa5610_0\",\"lines\":\"CMD [\\\"uvicorn\\\", \\\"main:app\\\", \\\"--host\\\", \\\"0.0.0.0\\\", \\\"--port\\\", \\\"8000\\\"]\",\"is_ignored\":false,\"validation_state\":\"NO_VALIDATOR\",\"engine_kind\":\"OSS\"}},{\"check_id\":\"python.lang.security.audit.formatted-sql-query.formatted-sql-query\",\"path\":\"insecure-api/main.py\",\"start\":{\"line\":119,\"col\":9,\"offset\":4547},\"end\":{\"line\":119,\"col\":34,\"offset\":4572},\"extra\":{\"metavars\":{\"$X\":{\"start\":{\"line\":118,\"col\":65,\"offset\":4530},\"end\":{\"line\":118,\"col\":70,\"offset\":4535},\"abstract_content\":\"query\"},\"$DB\":{\"start\":{\"line\":119,\"col\":9,\"offset\":4547},\"end\":{\"line\":119,\"col\":15,\"offset\":4553},\"abstract_content\":\"cursor\",\"propagated_value\":{\"svalue_start\":{\"line\":116,\"col\":14,\"offset\":4443},\"svalue_end\":{\"line\":116,\"col\":27,\"offset\":4456},\"svalue_abstract_content\":\"conn.cursor()\"}},\"$SQL\":{\"start\":{\"line\":119,\"col\":24,\"offset\":4562},\"end\":{\"line\":119,\"col\":33,\"offset\":4571},\"abstract_content\":\"sql_query\",\"propagated_value\":{\"svalue_start\":{\"line\":118,\"col\":21,\"offset\":4486},\"svalue_end\":{\"line\":118,\"col\":73,\"offset\":4538},\"svalue_abstract_content\":\"f\\\"SELECT * FROM video_games WHERE title = '{query}'\\\"\"}}},\"message\":\"Detected possible formatted SQL query. Use parameterized queries instead.\",\"metadata\":{\"owasp\":[\"A01:2017 - Injection\",\"A03:2021 - Injection\"],\"cwe\":[\"CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')\"],\"references\":[\"https://stackoverflow.com/questions/775296/mysql-parameterized-queries\"],\"category\":\"security\",\"technology\":[\"python\"],\"cwe2022-top25\":true,\"cwe2021-top25\":true,\"subcategory\":[\"audit\"],\"likelihood\":\"LOW\",\"impact\":\"HIGH\",\"confidence\":\"LOW\",\"license\":\"Semgrep Rules License v1.0. For more details, visit semgrep.dev/legal/rules-license\",\"vulnerability_class\":[\"SQL Injection\"],\"source\":\"https://semgrep.dev/r/python.lang.security.audit.formatted-sql-query.formatted-sql-query\",\"shortlink\":\"https://sg.run/EkWw\",\"semgrep.dev\":{\"rule\":{\"origin\":\"community\",\"r_id\":9637,\"rule_id\":\"3qUP9k\",\"rv_id\":946343,\"url\":\"https://semgrep.dev/playground/r/e1T98KK/python.lang.security.audit.formatted-sql-query.formatted-sql-query\",\"version_id\":\"e1T98KK\"}}},\"severity\":\"WARNING\",\"fingerprint\":\"c84a51a76657aa903cb26be4bb0a60c776dad0b186e5cfeca8de49b1100d223a0079207827b48de997c97f92526ec0509bfe21c3587dda43bb2ffd3dc27a7a59_0\",\"lines\":\" cursor.execute(sql_query)\",\"is_ignored\":false,\"validation_state\":\"NO_VALIDATOR\",\"engine_kind\":\"OSS\"}},{\"check_id\":\"python.sqlalchemy.security.sqlalchemy-execute-raw-query.sqlalchemy-execute-raw-query\",\"path\":\"insecure-api/main.py\",\"start\":{\"line\":119,\"col\":9,\"offset\":4547},\"end\":{\"line\":119,\"col\":34,\"offset\":4572},\"extra\":{\"metavars\":{\"$CONNECTION\":{\"start\":{\"line\":119,\"col\":9,\"offset\":4547},\"end\":{\"line\":119,\"col\":15,\"offset\":4553},\"abstract_content\":\"cursor\",\"propagated_value\":{\"svalue_start\":{\"line\":116,\"col\":14,\"offset\":4443},\"svalue_end\":{\"line\":116,\"col\":27,\"offset\":4456},\"svalue_abstract_content\":\"conn.cursor()\"}},\"$QUERY\":{\"start\":{\"line\":119,\"col\":24,\"offset\":4562},\"end\":{\"line\":119,\"col\":33,\"offset\":4571},\"abstract_content\":\"sql_query\",\"propagated_value\":{\"svalue_start\":{\"line\":118,\"col\":21,\"offset\":4486},\"svalue_end\":{\"line\":118,\"col\":73,\"offset\":4538},\"svalue_abstract_content\":\"f\\\"SELECT * FROM video_games WHERE title = '{query}'\\\"\"}}},\"message\":\"Avoiding SQL string concatenation: untrusted input concatenated with raw SQL query can result in SQL Injection. In order to execute raw query safely, prepared statement should be used. SQLAlchemy provides TextualSQL to easily used prepared statement with named parameters. For complex SQL composition, use SQL Expression Language or Schema Definition Language. In most cases, SQLAlchemy ORM will be a better option.\",\"metadata\":{\"cwe\":[\"CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')\"],\"owasp\":[\"A01:2017 - Injection\",\"A03:2021 - Injection\"],\"references\":[\"https://docs.sqlalchemy.org/en/14/core/tutorial.html#using-textual-sql\",\"https://www.tutorialspoint.com/sqlalchemy/sqlalchemy_quick_guide.htm\",\"https://docs.sqlalchemy.org/en/14/core/tutorial.html#using-more-specific-text-with-table-expression-literal-column-and-expression-column\"],\"category\":\"security\",\"technology\":[\"sqlalchemy\"],\"cwe2022-top25\":true,\"cwe2021-top25\":true,\"subcategory\":[\"audit\"],\"likelihood\":\"LOW\",\"impact\":\"HIGH\",\"confidence\":\"LOW\",\"license\":\"Semgrep Rules License v1.0. For more details, visit semgrep.dev/legal/rules-license\",\"vulnerability_class\":[\"SQL Injection\"],\"source\":\"https://semgrep.dev/r/python.sqlalchemy.security.sqlalchemy-execute-raw-query.sqlalchemy-execute-raw-query\",\"shortlink\":\"https://sg.run/2b1L\",\"semgrep.dev\":{\"rule\":{\"origin\":\"community\",\"r_id\":10563,\"rule_id\":\"oqUz5y\",\"rv_id\":946452,\"url\":\"https://semgrep.dev/playground/r/8KTKj19/python.sqlalchemy.security.sqlalchemy-execute-raw-query.sqlalchemy-execute-raw-query\",\"version_id\":\"8KTKj19\"}}},\"severity\":\"ERROR\",\"fingerprint\":\"d66c7cd53b2919cf51e6625ae54a536489fdd8ea3ee6330b5a0fb2fd8bde2c819a5bc02728be7489ec513a519455c15b9c01ad0b3f43db19902a99f6220b7dfe_0\",\"lines\":\" cursor.execute(sql_query)\",\"is_ignored\":false,\"validation_state\":\"NO_VALIDATOR\",\"engine_kind\":\"OSS\"}},{\"check_id\":\"python.flask.security.injection.ssrf-requests.ssrf-requests\",\"path\":\"insecure-api/main.py\",\"start\":{\"line\":205,\"col\":20,\"offset\":8279},\"end\":{\"line\":205,\"col\":37,\"offset\":8296},\"extra\":{\"metavars\":{\"$1\":{\"start\":{\"line\":1,\"col\":1,\"offset\":0},\"end\":{\"line\":1,\"col\":4,\"offset\":3},\"abstract_content\":\"get\"},\"$APP\":{\"start\":{\"line\":201,\"col\":2,\"offset\":8108},\"end\":{\"line\":201,\"col\":5,\"offset\":8111},\"abstract_content\":\"app\"},\"$ROUTE_METHOD\":{\"start\":{\"line\":201,\"col\":6,\"offset\":8112},\"end\":{\"line\":201,\"col\":9,\"offset\":8115},\"abstract_content\":\"get\"},\"$ROUTE\":{\"start\":{\"line\":201,\"col\":10,\"offset\":8116},\"end\":{\"line\":201,\"col\":22,\"offset\":8128},\"abstract_content\":\"\\\"/fetch_url\\\"\"},\"$ROUTE_FUNC\":{\"start\":{\"line\":202,\"col\":5,\"offset\":8134},\"end\":{\"line\":202,\"col\":22,\"offset\":8151},\"abstract_content\":\"fetch_url_content\"},\"$ROUTEVAR\":{\"start\":{\"line\":202,\"col\":23,\"offset\":8152},\"end\":{\"line\":202,\"col\":26,\"offset\":8155},\"abstract_content\":\"url\"},\"$FUNC\":{\"start\":{\"line\":205,\"col\":29,\"offset\":8288},\"end\":{\"line\":205,\"col\":32,\"offset\":8291},\"abstract_content\":\"get\"}},\"message\":\"Data from request object is passed to a new server-side request. This could lead to a server-side request forgery (SSRF). To mitigate, ensure that schemes and hosts are validated against an allowlist, do not forward the response to the user, and ensure proper authentication and transport-layer security in the proxied request.\",\"metadata\":{\"cwe\":[\"CWE-918: Server-Side Request Forgery (SSRF)\"],\"owasp\":[\"A10:2021 - Server-Side Request Forgery (SSRF)\"],\"references\":[\"https://owasp.org/www-community/attacks/Server_Side_Request_Forgery\"],\"category\":\"security\",\"technology\":[\"flask\"],\"cwe2022-top25\":true,\"cwe2021-top25\":true,\"subcategory\":[\"vuln\"],\"likelihood\":\"MEDIUM\",\"impact\":\"HIGH\",\"confidence\":\"MEDIUM\",\"license\":\"Semgrep Rules License v1.0. For more details, visit semgrep.dev/legal/rules-license\",\"vulnerability_class\":[\"Server-Side Request Forgery (SSRF)\"],\"source\":\"https://semgrep.dev/r/python.flask.security.injection.ssrf-requests.ssrf-requests\",\"shortlink\":\"https://sg.run/J9LW\",\"semgrep.dev\":{\"rule\":{\"origin\":\"community\",\"r_id\":9546,\"rule_id\":\"WAUoRx\",\"rv_id\":946226,\"url\":\"https://semgrep.dev/playground/r/o5TZe8r/python.flask.security.injection.ssrf-requests.ssrf-requests\",\"version_id\":\"o5TZe8r\"}}},\"severity\":\"ERROR\",\"fingerprint\":\"9e243fdc21bcced9424a80b9158edd83090c25b66dceae7cd494643a58b03a05f86accfcec4bc79b0255a5401dee3d746946ab804283eed20604266d0e5dd9a0_0\",\"lines\":\" response = requests.get(url)\",\"is_ignored\":false,\"validation_state\":\"NO_VALIDATOR\",\"engine_kind\":\"OSS\"}},{\"check_id\":\"dockerfile.security.missing-user.missing-user\",\"path\":\"insecure-app/Dockerfile\",\"start\":{\"line\":34,\"col\":1,\"offset\":1048},\"end\":{\"line\":34,\"col\":31,\"offset\":1078},\"extra\":{\"metavars\":{\"$...VARS\":{\"start\":{\"line\":34,\"col\":5,\"offset\":1052},\"end\":{\"line\":34,\"col\":31,\"offset\":1078},\"abstract_content\":\"[\\\"python3\\\"\\\"/app/app.py\\\"]\"}},\"message\":\"By not specifying a USER, a program in the container may run as 'root'. This is a security hazard. If an attacker can control a process running as root, they may have control over the container. Ensure that the last USER in a Dockerfile is a USER other than 'root'.\",\"fix\":\"USER non-root\\nCMD [\\\"python3\\\", \\\"/app/app.py\\\"]\",\"metadata\":{\"cwe\":[\"CWE-269: Improper Privilege Management\"],\"category\":\"security\",\"technology\":[\"dockerfile\"],\"confidence\":\"MEDIUM\",\"owasp\":[\"A04:2021 - Insecure Design\"],\"references\":[\"https://owasp.org/Top10/A04_2021-Insecure_Design\"],\"subcategory\":[\"audit\"],\"likelihood\":\"LOW\",\"impact\":\"MEDIUM\",\"license\":\"Semgrep Rules License v1.0. For more details, visit semgrep.dev/legal/rules-license\",\"vulnerability_class\":[\"Improper Authorization\"],\"source\":\"https://semgrep.dev/r/dockerfile.security.missing-user.missing-user\",\"shortlink\":\"https://sg.run/Gbvn\",\"semgrep.dev\":{\"rule\":{\"origin\":\"community\",\"r_id\":20148,\"rule_id\":\"AbUN06\",\"rv_id\":945269,\"url\":\"https://semgrep.dev/playground/r/qkT4j4L/dockerfile.security.missing-user.missing-user\",\"version_id\":\"qkT4j4L\"}}},\"severity\":\"ERROR\",\"fingerprint\":\"af5e9dedee89e966f4a977ada65c8cf6eddc2c5c8bd31c9d5e6ade032a2f62b150ebe50e2f3aa6796806d4881ee2ded63e7cdf7b427f3a98e24a6dde432ad2ef_0\",\"lines\":\"CMD [\\\"python3\\\", \\\"/app/app.py\\\"]\",\"is_ignored\":false,\"validation_state\":\"NO_VALIDATOR\",\"engine_kind\":\"OSS\"}},{\"check_id\":\"generic.secrets.security.detected-aws-access-key-id-value.detected-aws-access-key-id-value\",\"path\":\"insecure-app/app.py\",\"start\":{\"line\":9,\"col\":22,\"offset\":231},\"end\":{\"line\":9,\"col\":42,\"offset\":251},\"extra\":{\"metavars\":{\"$1\":{\"start\":{\"line\":9,\"col\":22,\"offset\":231},\"end\":{\"line\":9,\"col\":26,\"offset\":235},\"abstract_content\":\"AKIA\"}},\"message\":\"AWS Access Key ID Value detected. This is a sensitive credential and should not be hardcoded here. Instead, read this value from an environment variable or keep it in a separate, private file.\",\"metadata\":{\"cwe\":[\"CWE-798: Use of Hard-coded Credentials\"],\"source-rule-url\":\"https://github.com/grab/secret-scanner/blob/master/scanner/signatures/pattern.go\",\"category\":\"security\",\"technology\":[\"secrets\",\"aws\"],\"confidence\":\"LOW\",\"owasp\":[\"A07:2021 - Identification and Authentication Failures\"],\"references\":[\"https://owasp.org/Top10/A07_2021-Identification_and_Authentication_Failures\"],\"cwe2022-top25\":true,\"cwe2021-top25\":true,\"subcategory\":[\"audit\"],\"likelihood\":\"LOW\",\"impact\":\"HIGH\",\"license\":\"Semgrep Rules License v1.0. For more details, visit semgrep.dev/legal/rules-license\",\"vulnerability_class\":[\"Hard-coded Secrets\"],\"source\":\"https://semgrep.dev/r/generic.secrets.security.detected-aws-access-key-id-value.detected-aws-access-key-id-value\",\"shortlink\":\"https://sg.run/GeD1\",\"semgrep.dev\":{\"rule\":{\"origin\":\"community\",\"r_id\":9048,\"rule_id\":\"oqUevO\",\"rv_id\":945484,\"url\":\"https://semgrep.dev/playground/r/rxT6rnL/generic.secrets.security.detected-aws-access-key-id-value.detected-aws-access-key-id-value\",\"version_id\":\"rxT6rnL\"}}},\"severity\":\"ERROR\",\"fingerprint\":\"892f89afd53ea85da48c96befb7a856343567d35c775f901480c221b6b048d9ece1928a7cceeedc1d30e8d7c762a4c2f7730d46151e699a477824161b3859c88_0\",\"lines\":\"aws_access_key_id = 'AKIA2JAPX77RGLB664VE'\",\"is_ignored\":false,\"validation_state\":\"NO_VALIDATOR\",\"engine_kind\":\"OSS\"}},{\"check_id\":\"generic.secrets.security.detected-aws-secret-access-key.detected-aws-secret-access-key\",\"path\":\"insecure-app/app.py\",\"start\":{\"line\":10,\"col\":1,\"offset\":253},\"end\":{\"line\":10,\"col\":56,\"offset\":308},\"extra\":{\"metavars\":{\"$3\":{\"start\":{\"line\":10,\"col\":1,\"offset\":253},\"end\":{\"line\":10,\"col\":4,\"offset\":256},\"abstract_content\":\"aws\"},\"$1\":{\"start\":{\"line\":10,\"col\":1,\"offset\":253},\"end\":{\"line\":10,\"col\":56,\"offset\":308},\"abstract_content\":\"aws_secret = 'v5xpjkWYoy45fGKFSMajSn+sqs22WI2niacX9yO5'\"},\"$4\":{\"start\":{\"line\":10,\"col\":5,\"offset\":257},\"end\":{\"line\":10,\"col\":11,\"offset\":263},\"abstract_content\":\"secret\"},\"$6\":{\"start\":{\"line\":10,\"col\":12,\"offset\":264},\"end\":{\"line\":10,\"col\":13,\"offset\":265},\"abstract_content\":\"=\"},\"$7\":{\"start\":{\"line\":10,\"col\":14,\"offset\":266},\"end\":{\"line\":10,\"col\":15,\"offset\":267},\"abstract_content\":\"'\"},\"$8\":{\"start\":{\"line\":10,\"col\":55,\"offset\":307},\"end\":{\"line\":10,\"col\":56,\"offset\":308},\"abstract_content\":\"'\"}},\"message\":\"AWS Secret Access Key detected\",\"metadata\":{\"cwe\":[\"CWE-798: Use of Hard-coded Credentials\"],\"source-rule-url\":\"https://github.com/grab/secret-scanner/blob/master/scanner/signatures/pattern.go\",\"category\":\"security\",\"technology\":[\"secrets\",\"aws\"],\"confidence\":\"LOW\",\"owasp\":[\"A07:2021 - Identification and Authentication Failures\"],\"references\":[\"https://owasp.org/Top10/A07_2021-Identification_and_Authentication_Failures\"],\"cwe2022-top25\":true,\"cwe2021-top25\":true,\"subcategory\":[\"audit\"],\"likelihood\":\"LOW\",\"impact\":\"HIGH\",\"license\":\"Semgrep Rules License v1.0. For more details, visit semgrep.dev/legal/rules-license\",\"vulnerability_class\":[\"Hard-coded Secrets\"],\"source\":\"https://semgrep.dev/r/generic.secrets.security.detected-aws-secret-access-key.detected-aws-secret-access-key\",\"shortlink\":\"https://sg.run/Bk39\",\"semgrep.dev\":{\"rule\":{\"origin\":\"community\",\"r_id\":9051,\"rule_id\":\"2ZUbe8\",\"rv_id\":945487,\"url\":\"https://semgrep.dev/playground/r/kbTYkWD/generic.secrets.security.detected-aws-secret-access-key.detected-aws-secret-access-key\",\"version_id\":\"kbTYkWD\"}}},\"severity\":\"ERROR\",\"fingerprint\":\"13e25a7e818f3f0cd4c3ad50c3011eb98a0974336fb4790385234062c218c6931f0323eb80fe101996bebcadbae4de0f7ee5fc03f90632544d2c701619374ab0_0\",\"lines\":\"aws_secret = 'v5xpjkWYoy45fGKFSMajSn+sqs22WI2niacX9yO5'\",\"is_ignored\":false,\"validation_state\":\"NO_VALIDATOR\",\"engine_kind\":\"OSS\"}},{\"check_id\":\"python.lang.security.audit.formatted-sql-query.formatted-sql-query\",\"path\":\"insecure-app/app.py\",\"start\":{\"line\":23,\"col\":9,\"offset\":545},\"end\":{\"line\":23,\"col\":111,\"offset\":647},\"extra\":{\"metavars\":{\"$DB\":{\"start\":{\"line\":23,\"col\":9,\"offset\":545},\"end\":{\"line\":23,\"col\":15,\"offset\":551},\"abstract_content\":\"cursor\",\"propagated_value\":{\"svalue_start\":{\"line\":19,\"col\":14,\"offset\":480},\"svalue_end\":{\"line\":19,\"col\":25,\"offset\":491},\"svalue_abstract_content\":\"db.cursor()\"}}},\"message\":\"Detected possible formatted SQL query. Use parameterized queries instead.\",\"metadata\":{\"owasp\":[\"A01:2017 - Injection\",\"A03:2021 - Injection\"],\"cwe\":[\"CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')\"],\"references\":[\"https://stackoverflow.com/questions/775296/mysql-parameterized-queries\"],\"category\":\"security\",\"technology\":[\"python\"],\"cwe2022-top25\":true,\"cwe2021-top25\":true,\"subcategory\":[\"audit\"],\"likelihood\":\"LOW\",\"impact\":\"HIGH\",\"confidence\":\"LOW\",\"license\":\"Semgrep Rules License v1.0. For more details, visit semgrep.dev/legal/rules-license\",\"vulnerability_class\":[\"SQL Injection\"],\"source\":\"https://semgrep.dev/r/python.lang.security.audit.formatted-sql-query.formatted-sql-query\",\"shortlink\":\"https://sg.run/EkWw\",\"semgrep.dev\":{\"rule\":{\"origin\":\"community\",\"r_id\":9637,\"rule_id\":\"3qUP9k\",\"rv_id\":946343,\"url\":\"https://semgrep.dev/playground/r/e1T98KK/python.lang.security.audit.formatted-sql-query.formatted-sql-query\",\"version_id\":\"e1T98KK\"}}},\"severity\":\"WARNING\",\"fingerprint\":\"bd3ed91c83ee049b51adf30ea5466f1461a8ff279db4115fdc50481292f4bd5a7eb1d0a541c81817dcba1091d202020a2ad429adad88ba47bf95ae3de09dc82e_0\",\"lines\":\" cursor.execute(\\\"SELECT * FROM users WHERE username = '%s' AND password = '%s'\\\" % (username, password))\",\"is_ignored\":false,\"validation_state\":\"NO_VALIDATOR\",\"engine_kind\":\"OSS\"}},{\"check_id\":\"python.sqlalchemy.security.sqlalchemy-execute-raw-query.sqlalchemy-execute-raw-query\",\"path\":\"insecure-app/app.py\",\"start\":{\"line\":23,\"col\":9,\"offset\":545},\"end\":{\"line\":23,\"col\":111,\"offset\":647},\"extra\":{\"metavars\":{\"$CONNECTION\":{\"start\":{\"line\":23,\"col\":9,\"offset\":545},\"end\":{\"line\":23,\"col\":15,\"offset\":551},\"abstract_content\":\"cursor\",\"propagated_value\":{\"svalue_start\":{\"line\":19,\"col\":14,\"offset\":480},\"svalue_end\":{\"line\":19,\"col\":25,\"offset\":491},\"svalue_abstract_content\":\"db.cursor()\"}},\"$SQL\":{\"start\":{\"line\":23,\"col\":24,\"offset\":560},\"end\":{\"line\":23,\"col\":87,\"offset\":623},\"abstract_content\":\"\\\"SELECT * FROM users WHERE username = '%s' AND password = '%s'\\\"\"}},\"message\":\"Avoiding SQL string concatenation: untrusted input concatenated with raw SQL query can result in SQL Injection. In order to execute raw query safely, prepared statement should be used. SQLAlchemy provides TextualSQL to easily used prepared statement with named parameters. For complex SQL composition, use SQL Expression Language or Schema Definition Language. In most cases, SQLAlchemy ORM will be a better option.\",\"metadata\":{\"cwe\":[\"CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')\"],\"owasp\":[\"A01:2017 - Injection\",\"A03:2021 - Injection\"],\"references\":[\"https://docs.sqlalchemy.org/en/14/core/tutorial.html#using-textual-sql\",\"https://www.tutorialspoint.com/sqlalchemy/sqlalchemy_quick_guide.htm\",\"https://docs.sqlalchemy.org/en/14/core/tutorial.html#using-more-specific-text-with-table-expression-literal-column-and-expression-column\"],\"category\":\"security\",\"technology\":[\"sqlalchemy\"],\"cwe2022-top25\":true,\"cwe2021-top25\":true,\"subcategory\":[\"audit\"],\"likelihood\":\"LOW\",\"impact\":\"HIGH\",\"confidence\":\"LOW\",\"license\":\"Semgrep Rules License v1.0. For more details, visit semgrep.dev/legal/rules-license\",\"vulnerability_class\":[\"SQL Injection\"],\"source\":\"https://semgrep.dev/r/python.sqlalchemy.security.sqlalchemy-execute-raw-query.sqlalchemy-execute-raw-query\",\"shortlink\":\"https://sg.run/2b1L\",\"semgrep.dev\":{\"rule\":{\"origin\":\"community\",\"r_id\":10563,\"rule_id\":\"oqUz5y\",\"rv_id\":946452,\"url\":\"https://semgrep.dev/playground/r/8KTKj19/python.sqlalchemy.security.sqlalchemy-execute-raw-query.sqlalchemy-execute-raw-query\",\"version_id\":\"8KTKj19\"}}},\"severity\":\"ERROR\",\"fingerprint\":\"1fb224609ca4d43b11a045658892258157b1de945c0814280f9f46badbd9f5400b93a2859da72a325226c083771a13fcd20474bff7e1efb084d3f2c0d8debc09_0\",\"lines\":\" cursor.execute(\\\"SELECT * FROM users WHERE username = '%s' AND password = '%s'\\\" % (username, password))\",\"is_ignored\":false,\"validation_state\":\"NO_VALIDATOR\",\"engine_kind\":\"OSS\"}},{\"check_id\":\"python.flask.security.injection.subprocess-injection.subprocess-injection\",\"path\":\"insecure-app/app.py\",\"start\":{\"line\":31,\"col\":23,\"offset\":841},\"end\":{\"line\":31,\"col\":104,\"offset\":922},\"extra\":{\"metavars\":{\"$FUNC\":{\"start\":{\"line\":31,\"col\":34,\"offset\":852},\"end\":{\"line\":31,\"col\":39,\"offset\":857},\"abstract_content\":\"Popen\"}},\"message\":\"Detected user input entering a `subprocess` call unsafely. This could result in a command injection vulnerability. An attacker could use this vulnerability to execute arbitrary commands on the host, which allows them to download malware, scan sensitive data, or run any command they wish on the server. Do not let users choose the command to run. In general, prefer to use Python API versions of system commands. If you must use subprocess, use a dictionary to allowlist a set of commands.\",\"metadata\":{\"category\":\"security\",\"technology\":[\"flask\"],\"owasp\":[\"A01:2017 - Injection\",\"A03:2021 - Injection\"],\"cwe\":[\"CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')\"],\"references\":[\"https://semgrep.dev/docs/cheat-sheets/python-command-injection/\"],\"confidence\":\"HIGH\",\"cwe2022-top25\":true,\"cwe2021-top25\":true,\"subcategory\":[\"vuln\"],\"likelihood\":\"HIGH\",\"impact\":\"MEDIUM\",\"license\":\"Semgrep Rules License v1.0. For more details, visit semgrep.dev/legal/rules-license\",\"vulnerability_class\":[\"Command Injection\"],\"source\":\"https://semgrep.dev/r/python.flask.security.injection.subprocess-injection.subprocess-injection\",\"shortlink\":\"https://sg.run/5gW3\",\"semgrep.dev\":{\"rule\":{\"origin\":\"community\",\"r_id\":31147,\"rule_id\":\"8GU3qp\",\"rv_id\":946227,\"url\":\"https://semgrep.dev/playground/r/zyTlk7Y/python.flask.security.injection.subprocess-injection.subprocess-injection\",\"version_id\":\"zyTlk7Y\"}}},\"severity\":\"ERROR\",\"fingerprint\":\"3c4c4959625cb597aa8cf78e5feb44e5b02a16808ab6755551da9a678a7d7b2fb68b312e92a7f8368402331a094719ba4a2599894b5384ffd4d059c82b08374f_0\",\"lines\":\" process = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)\",\"is_ignored\":false,\"validation_state\":\"NO_VALIDATOR\",\"dataflow_trace\":{\"taint_source\":[\"CliLoc\",[{\"path\":\"insecure-app/app.py\",\"start\":{\"line\":30,\"col\":19,\"offset\":795},\"end\":{\"line\":30,\"col\":42,\"offset\":818}},\"request.form['command']\"]],\"intermediate_vars\":[{\"location\":{\"path\":\"insecure-app/app.py\",\"start\":{\"line\":30,\"col\":13,\"offset\":789},\"end\":{\"line\":30,\"col\":16,\"offset\":792}},\"content\":\"cmd\"}],\"taint_sink\":[\"CliLoc\",[{\"path\":\"insecure-app/app.py\",\"start\":{\"line\":31,\"col\":23,\"offset\":841},\"end\":{\"line\":31,\"col\":104,\"offset\":922}},\"subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)\"]]},\"engine_kind\":\"OSS\"}},{\"check_id\":\"python.flask.os.tainted-os-command-stdlib-flask-secure-if-array.tainted-os-command-stdlib-flask-secure-if-array\",\"path\":\"insecure-app/app.py\",\"start\":{\"line\":31,\"col\":40,\"offset\":858},\"end\":{\"line\":31,\"col\":43,\"offset\":861},\"extra\":{\"metavars\":{\"$1\":{\"start\":{\"line\":1,\"col\":1,\"offset\":0},\"end\":{\"line\":1,\"col\":5,\"offset\":4},\"abstract_content\":\"form\"},\"$PROPERTY\":{\"start\":{\"line\":30,\"col\":27,\"offset\":803},\"end\":{\"line\":30,\"col\":31,\"offset\":807},\"abstract_content\":\"form\"},\"$SINK\":{\"start\":{\"line\":31,\"col\":40,\"offset\":858},\"end\":{\"line\":31,\"col\":43,\"offset\":861},\"abstract_content\":\"cmd\",\"propagated_value\":{\"svalue_start\":{\"line\":30,\"col\":19,\"offset\":795},\"svalue_end\":{\"line\":30,\"col\":42,\"offset\":818},\"svalue_abstract_content\":\"request.form['command']\"}}},\"message\":\"Untrusted input might be injected into a command executed by the application, which can lead to a command injection vulnerability. An attacker can execute arbitrary commands, potentially gaining complete control of the system. To prevent this vulnerability, avoid executing OS commands with user input. If this is unavoidable, validate and sanitize the input, and use safe methods for executing the commands.\",\"metadata\":{\"likelihood\":\"MEDIUM\",\"impact\":\"HIGH\",\"confidence\":\"HIGH\",\"category\":\"security\",\"subcategory\":[\"vuln\"],\"cwe\":[\"CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')\"],\"cwe2020-top25\":true,\"cwe2021-top25\":true,\"cwe2022-top25\":true,\"display-name\":\"OS Command Injection with Flask\",\"functional-categories\":[\"os::sink::os-command-or-thread::commands\",\"os::sink::os-command-or-thread::os\",\"os::sink::os-command-or-thread::popen2\",\"os::sink::os-command-or-thread::stdlib\",\"os::sink::os-command-or-thread::stdlib2\",\"os::sink::os-command-or-thread::stdlib3\",\"os::sink::os-command-or-thread::subprocess\",\"web::source::cookie::flask\",\"web::source::form-data::flask\",\"web::source::form-data::flask-wtf\",\"web::source::form-data::wtforms\",\"web::source::header::flask\",\"web::source::http-body::flask\",\"web::source::http-params::flask\",\"web::source::url-path-params::flask\"],\"owasp\":[\"A01:2017 - Injection\",\"A03:2021 - Injection\"],\"references\":[\"https://docs.python.org/3/library/os.html\",\"https://docs.python.org/3/library/subprocess.html#subprocess.Popen\",\"https://owasp.org/Top10/A03_2021-Injection\",\"https://semgrep.dev/docs/cheat-sheets/python-command-injection/\",\"https://stackless.readthedocs.io/en/v2.7.16-slp/library/commands.html\"],\"technology\":[\"commands\",\"flask\",\"flask-wtf\",\"os\",\"popen2\",\"stdlib\",\"stdlib2\",\"stdlib3\",\"subprocess\",\"web\",\"wtforms\"],\"license\":\"Semgrep Rules License v1.0. For more details, visit semgrep.dev/legal/rules-license\",\"vulnerability_class\":[\"Command Injection\"],\"source\":\"https://semgrep.dev/r/python.flask.os.tainted-os-command-stdlib-flask-secure-if-array.tainted-os-command-stdlib-flask-secure-if-array\",\"shortlink\":\"https://sg.run/bwjrP\",\"semgrep.dev\":{\"rule\":{\"origin\":\"pro_rules\",\"r_id\":139670,\"rule_id\":\"PeUJ9BR\",\"rv_id\":947955,\"url\":\"https://semgrep.dev/playground/r/kbTYREe/python.flask.os.tainted-os-command-stdlib-flask-secure-if-array.tainted-os-command-stdlib-flask-secure-if-array\",\"version_id\":\"kbTYREe\"}}},\"severity\":\"ERROR\",\"fingerprint\":\"11ab4317b1cc9c256e619e6eca976181caf7c7671e75dde752d0e6b5191147c9ee4983369ccb7414b693729c0b958333f0472b9b723e59e30443c9b145f7e7e8_0\",\"lines\":\" process = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)\",\"is_ignored\":false,\"validation_state\":\"NO_VALIDATOR\",\"dataflow_trace\":{\"taint_source\":[\"CliLoc\",[{\"path\":\"insecure-app/app.py\",\"start\":{\"line\":30,\"col\":19,\"offset\":795},\"end\":{\"line\":30,\"col\":42,\"offset\":818}},\"request.form['command']\"]],\"intermediate_vars\":[{\"location\":{\"path\":\"insecure-app/app.py\",\"start\":{\"line\":30,\"col\":13,\"offset\":789},\"end\":{\"line\":30,\"col\":16,\"offset\":792}},\"content\":\"cmd\"}],\"taint_sink\":[\"CliLoc\",[{\"path\":\"insecure-app/app.py\",\"start\":{\"line\":31,\"col\":40,\"offset\":858},\"end\":{\"line\":31,\"col\":43,\"offset\":861}},\"cmd\"]]},\"engine_kind\":\"OSS\"}},{\"check_id\":\"python.lang.security.dangerous-subprocess-use.dangerous-subprocess-use\",\"path\":\"insecure-app/app.py\",\"start\":{\"line\":31,\"col\":40,\"offset\":858},\"end\":{\"line\":31,\"col\":43,\"offset\":861},\"extra\":{\"metavars\":{\"$FUNC\":{\"start\":{\"line\":31,\"col\":34,\"offset\":852},\"end\":{\"line\":31,\"col\":39,\"offset\":857},\"abstract_content\":\"Popen\"},\"$CMD\":{\"start\":{\"line\":31,\"col\":40,\"offset\":858},\"end\":{\"line\":31,\"col\":43,\"offset\":861},\"abstract_content\":\"cmd\",\"propagated_value\":{\"svalue_start\":{\"line\":30,\"col\":19,\"offset\":795},\"svalue_end\":{\"line\":30,\"col\":42,\"offset\":818},\"svalue_abstract_content\":\"request.form['command']\"}}},\"message\":\"Detected subprocess function 'Popen' with user controlled data. A malicious actor could leverage this to perform command injection. You may consider using 'shlex.escape()'.\",\"metadata\":{\"owasp\":[\"A01:2017 - Injection\",\"A03:2021 - Injection\"],\"cwe\":[\"CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')\"],\"asvs\":{\"control_id\":\"5.3.8 OS Command Injection\",\"control_url\":\"https://github.com/OWASP/ASVS/blob/master/4.0/en/0x13-V5-Validation-Sanitization-Encoding.md#v53-output-encoding-and-injection-prevention-requirements\",\"section\":\"V5: Validation, Sanitization and Encoding Verification Requirements\",\"version\":\"4\"},\"references\":[\"https://stackoverflow.com/questions/3172470/actual-meaning-of-shell-true-in-subprocess\",\"https://docs.python.org/3/library/subprocess.html\",\"https://docs.python.org/3/library/shlex.html\",\"https://semgrep.dev/docs/cheat-sheets/python-command-injection/\"],\"category\":\"security\",\"technology\":[\"python\"],\"confidence\":\"MEDIUM\",\"cwe2022-top25\":true,\"cwe2021-top25\":true,\"subcategory\":[\"vuln\"],\"likelihood\":\"MEDIUM\",\"impact\":\"HIGH\",\"license\":\"Semgrep Rules License v1.0. For more details, visit semgrep.dev/legal/rules-license\",\"vulnerability_class\":[\"Command Injection\"],\"source\":\"https://semgrep.dev/r/python.lang.security.dangerous-subprocess-use.dangerous-subprocess-use\",\"shortlink\":\"https://sg.run/NWxp\",\"semgrep.dev\":{\"rule\":{\"origin\":\"community\",\"r_id\":27271,\"rule_id\":\"JDUz3R\",\"rv_id\":946391,\"url\":\"https://semgrep.dev/playground/r/9lTy1bg/python.lang.security.dangerous-subprocess-use.dangerous-subprocess-use\",\"version_id\":\"9lTy1bg\"}}},\"severity\":\"ERROR\",\"fingerprint\":\"6f0e63c619f951b4450d30c3b6e9d0078a540b139173b9dd62a26b4bb030219ef3541aaa9b1718d5ffecedd92bd4a6d528d14f1d3b12995cf0bcedd09a4bacf0_0\",\"lines\":\" process = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)\",\"is_ignored\":false,\"validation_state\":\"NO_VALIDATOR\",\"dataflow_trace\":{\"taint_source\":[\"CliLoc\",[{\"path\":\"insecure-app/app.py\",\"start\":{\"line\":30,\"col\":19,\"offset\":795},\"end\":{\"line\":30,\"col\":42,\"offset\":818}},\"request.form['command']\"]],\"intermediate_vars\":[{\"location\":{\"path\":\"insecure-app/app.py\",\"start\":{\"line\":30,\"col\":13,\"offset\":789},\"end\":{\"line\":30,\"col\":16,\"offset\":792}},\"content\":\"cmd\"}],\"taint_sink\":[\"CliLoc\",[{\"path\":\"insecure-app/app.py\",\"start\":{\"line\":31,\"col\":40,\"offset\":858},\"end\":{\"line\":31,\"col\":43,\"offset\":861}},\"cmd\"]]},\"engine_kind\":\"OSS\"}},{\"check_id\":\"python.lang.security.audit.subprocess-shell-true.subprocess-shell-true\",\"path\":\"insecure-app/app.py\",\"start\":{\"line\":31,\"col\":51,\"offset\":869},\"end\":{\"line\":31,\"col\":55,\"offset\":873},\"extra\":{\"metavars\":{\"$FUNC\":{\"start\":{\"line\":31,\"col\":34,\"offset\":852},\"end\":{\"line\":31,\"col\":39,\"offset\":857},\"abstract_content\":\"Popen\"},\"$TRUE\":{\"start\":{\"line\":31,\"col\":51,\"offset\":869},\"end\":{\"line\":31,\"col\":55,\"offset\":873},\"abstract_content\":\"True\"}},\"message\":\"Found 'subprocess' function 'Popen' with 'shell=True'. This is dangerous because this call will spawn the command using a shell process. Doing so propagates current shell settings and variables, which makes it much easier for a malicious actor to execute commands. Use 'shell=False' instead.\",\"fix\":\"False\",\"metadata\":{\"source-rule-url\":\"https://bandit.readthedocs.io/en/latest/plugins/b602_subprocess_popen_with_shell_equals_true.html\",\"owasp\":[\"A01:2017 - Injection\",\"A03:2021 - Injection\"],\"cwe\":[\"CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')\"],\"references\":[\"https://stackoverflow.com/questions/3172470/actual-meaning-of-shell-true-in-subprocess\",\"https://docs.python.org/3/library/subprocess.html\"],\"category\":\"security\",\"technology\":[\"python\"],\"cwe2022-top25\":true,\"cwe2021-top25\":true,\"subcategory\":[\"secure default\"],\"likelihood\":\"HIGH\",\"impact\":\"LOW\",\"confidence\":\"MEDIUM\",\"license\":\"Semgrep Rules License v1.0. For more details, visit semgrep.dev/legal/rules-license\",\"vulnerability_class\":[\"Command Injection\"],\"source\":\"https://semgrep.dev/r/python.lang.security.audit.subprocess-shell-true.subprocess-shell-true\",\"shortlink\":\"https://sg.run/J92w\",\"semgrep.dev\":{\"rule\":{\"origin\":\"community\",\"r_id\":9646,\"rule_id\":\"DbUpz2\",\"rv_id\":946382,\"url\":\"https://semgrep.dev/playground/r/YDTvReW/python.lang.security.audit.subprocess-shell-true.subprocess-shell-true\",\"version_id\":\"YDTvReW\"}}},\"severity\":\"ERROR\",\"fingerprint\":\"67b3f01781e5320338a679e28d25eb74a0afbdff9a8e8bf3e384dec075532a176d5d3a10c438e7756a4e38cd767938cdc9fef681fde2f488e574fd027b27a5f2_0\",\"lines\":\" process = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)\",\"is_ignored\":false,\"validation_state\":\"NO_VALIDATOR\",\"engine_kind\":\"OSS\"}},{\"check_id\":\"python.django.security.injection.sql.sql-injection-using-db-cursor-execute.sql-injection-db-cursor-execute\",\"path\":\"insecure-app/app.py\",\"start\":{\"line\":46,\"col\":13,\"offset\":1576},\"end\":{\"line\":58,\"col\":43,\"offset\":2133},\"extra\":{\"metavars\":{\"$FUNC\":{\"start\":{\"line\":15,\"col\":5,\"offset\":378},\"end\":{\"line\":15,\"col\":10,\"offset\":383},\"abstract_content\":\"index\"},\"$DATA\":{\"start\":{\"line\":46,\"col\":13,\"offset\":1576},\"end\":{\"line\":46,\"col\":16,\"offset\":1579},\"abstract_content\":\"sql\"},\"$W\":{\"start\":{\"line\":46,\"col\":27,\"offset\":1590},\"end\":{\"line\":46,\"col\":31,\"offset\":1594},\"abstract_content\":\"form\"},\"$CURSOR\":{\"start\":{\"line\":49,\"col\":17,\"offset\":1682},\"end\":{\"line\":49,\"col\":23,\"offset\":1688},\"abstract_content\":\"cursor\"}},\"message\":\"User-controlled data from a request is passed to 'execute()'. This could lead to a SQL injection and therefore protected information could be leaked. Instead, use django's QuerySets, which are built with query parameterization and therefore not vulnerable to sql injection. For example, you could use `Entry.objects.filter(date=2006)`.\",\"metadata\":{\"cwe\":[\"CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')\"],\"owasp\":[\"A01:2017 - Injection\",\"A03:2021 - Injection\"],\"references\":[\"https://docs.djangoproject.com/en/3.0/topics/security/#sql-injection-protection\"],\"category\":\"security\",\"technology\":[\"django\"],\"cwe2022-top25\":true,\"cwe2021-top25\":true,\"subcategory\":[\"vuln\"],\"likelihood\":\"MEDIUM\",\"impact\":\"HIGH\",\"confidence\":\"MEDIUM\",\"license\":\"Semgrep Rules License v1.0. For more details, visit semgrep.dev/legal/rules-license\",\"vulnerability_class\":[\"SQL Injection\"],\"source\":\"https://semgrep.dev/r/python.django.security.injection.sql.sql-injection-using-db-cursor-execute.sql-injection-db-cursor-execute\",\"shortlink\":\"https://sg.run/qx7y\",\"semgrep.dev\":{\"rule\":{\"origin\":\"community\",\"r_id\":9512,\"rule_id\":\"2ZUbDL\",\"rv_id\":946186,\"url\":\"https://semgrep.dev/playground/r/X0TL8rA/python.django.security.injection.sql.sql-injection-using-db-cursor-execute.sql-injection-db-cursor-execute\",\"version_id\":\"X0TL8rA\"}}},\"severity\":\"WARNING\",\"fingerprint\":\"b35bc65f56ad96a3e7dd4426467722cfb9fa4098152b35bfcb26998d73f364cccec3bc08fb082f6ea9c665dc2e40f5ee544cce5e89249b6b6d5542f95968849e_0\",\"lines\":\" sql = request.form['sql']\\n try:\\n # Execute the user's SQL query\\n cursor.execute(sql)\\n # Fetch all rows from the query result\\n rows = cursor.fetchall()\\n # Format the results for display\\n if rows:\\n output = \\\"Results:\\\\n\\\" + \\\"\\\\n\\\".join(str(row) for row in rows)\\n else:\\n output = \\\"Query executed successfully, but no results found.\\\"\\n except Exception as e:\\n output = f\\\"SQL Error: {e}\\\"\",\"is_ignored\":false,\"validation_state\":\"NO_VALIDATOR\",\"engine_kind\":\"OSS\"}},{\"check_id\":\"python.flask.db.generic-sql-flask.generic-sql-flask\",\"path\":\"insecure-app/app.py\",\"start\":{\"line\":49,\"col\":32,\"offset\":1697},\"end\":{\"line\":49,\"col\":35,\"offset\":1700},\"extra\":{\"metavars\":{\"$1\":{\"start\":{\"line\":1,\"col\":1,\"offset\":0},\"end\":{\"line\":1,\"col\":5,\"offset\":4},\"abstract_content\":\"form\"},\"$PROPERTY\":{\"start\":{\"line\":46,\"col\":27,\"offset\":1590},\"end\":{\"line\":46,\"col\":31,\"offset\":1594},\"abstract_content\":\"form\"},\"$AIOMYSQL_CURSOR\":{\"start\":{\"line\":49,\"col\":17,\"offset\":1682},\"end\":{\"line\":49,\"col\":23,\"offset\":1688},\"abstract_content\":\"cursor\"},\"$SINK\":{\"start\":{\"line\":49,\"col\":32,\"offset\":1697},\"end\":{\"line\":49,\"col\":35,\"offset\":1700},\"abstract_content\":\"sql\",\"propagated_value\":{\"svalue_start\":{\"line\":46,\"col\":19,\"offset\":1582},\"svalue_end\":{\"line\":46,\"col\":38,\"offset\":1601},\"svalue_abstract_content\":\"request.form['sql']\"}}},\"message\":\"Untrusted input might be used to build a database query, which can lead to a SQL injection vulnerability. An attacker can execute malicious SQL statements and gain unauthorized access to sensitive data, modify, delete data, or execute arbitrary system commands. The driver API has the ability to bind parameters to the query in a safe way. Make sure not to dynamically create SQL queries from user-influenced inputs. If you cannot avoid this, either escape the data properly or create an allowlist to check the value.\",\"metadata\":{\"likelihood\":\"HIGH\",\"impact\":\"HIGH\",\"confidence\":\"HIGH\",\"category\":\"security\",\"subcategory\":[\"vuln\"],\"cwe\":[\"CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')\"],\"cwe2020-top25\":true,\"cwe2021-top25\":true,\"cwe2022-top25\":true,\"display-name\":\"SQL Injection with Flask\",\"functional-categories\":[\"db::sink::sql-or-nosql-query::aiomysql\",\"db::sink::sql-or-nosql-query::aiopg\",\"db::sink::sql-or-nosql-query::mysql-connector\",\"db::sink::sql-or-nosql-query::mysqldb\",\"db::sink::sql-or-nosql-query::pep249\",\"db::sink::sql-or-nosql-query::psycopg2\",\"db::sink::sql-or-nosql-query::pymssql\",\"db::sink::sql-or-nosql-query::pymysql\",\"db::sink::sql-or-nosql-query::pyodbc\",\"web::source::cookie::flask\",\"web::source::form-data::flask\",\"web::source::form-data::flask-wtf\",\"web::source::form-data::wtforms\",\"web::source::header::flask\",\"web::source::http-body::flask\",\"web::source::http-params::flask\",\"web::source::url-path-params::flask\"],\"owasp\":[\"A01:2017 - Injection\",\"A03:2021 - Injection\"],\"references\":[\"https://owasp.org/Top10/A03_2021-Injection\"],\"technology\":[\"aiomysql\",\"aiopg\",\"db-api\",\"flask\",\"flask-wtf\",\"mssql\",\"mysql\",\"mysql-connector\",\"mysqldb\",\"pep249\",\"postgres\",\"psycopg2\",\"pymssql\",\"pymysql\",\"pyodbc\",\"sql\",\"web\",\"wtforms\"],\"license\":\"Semgrep Rules License v1.0. For more details, visit semgrep.dev/legal/rules-license\",\"vulnerability_class\":[\"SQL Injection\"],\"source\":\"https://semgrep.dev/r/python.flask.db.generic-sql-flask.generic-sql-flask\",\"shortlink\":\"https://sg.run/AbKXQ\",\"semgrep.dev\":{\"rule\":{\"origin\":\"pro_rules\",\"r_id\":116506,\"rule_id\":\"0oULG2d\",\"rv_id\":947908,\"url\":\"https://semgrep.dev/playground/r/rxT6kpn/python.flask.db.generic-sql-flask.generic-sql-flask\",\"version_id\":\"rxT6kpn\"}}},\"severity\":\"ERROR\",\"fingerprint\":\"45f29ae146b3bd34ec3dba49040437a0367c6109b5f020c58ca02551748a3e73c850103ae2374abdaed85b1d8fc26d668175f9a872279dd517cc3f59de3b4e4d_0\",\"lines\":\" cursor.execute(sql)\",\"is_ignored\":false,\"validation_state\":\"NO_VALIDATOR\",\"dataflow_trace\":{\"taint_source\":[\"CliLoc\",[{\"path\":\"insecure-app/app.py\",\"start\":{\"line\":46,\"col\":19,\"offset\":1582},\"end\":{\"line\":46,\"col\":38,\"offset\":1601}},\"request.form['sql']\"]],\"intermediate_vars\":[{\"location\":{\"path\":\"insecure-app/app.py\",\"start\":{\"line\":46,\"col\":13,\"offset\":1576},\"end\":{\"line\":46,\"col\":16,\"offset\":1579}},\"content\":\"sql\"}],\"taint_sink\":[\"CliLoc\",[{\"path\":\"insecure-app/app.py\",\"start\":{\"line\":49,\"col\":32,\"offset\":1697},\"end\":{\"line\":49,\"col\":35,\"offset\":1700}},\"sql\"]]},\"engine_kind\":\"OSS\"}},{\"check_id\":\"python.tars.flask.sql.prestodb.flask-prestodb-sqli.flask-prestodb-sqli\",\"path\":\"insecure-app/app.py\",\"start\":{\"line\":49,\"col\":32,\"offset\":1697},\"end\":{\"line\":49,\"col\":35,\"offset\":1700},\"extra\":{\"metavars\":{\"$1\":{\"start\":{\"line\":1,\"col\":1,\"offset\":0},\"end\":{\"line\":1,\"col\":5,\"offset\":4},\"abstract_content\":\"form\"},\"$PROPERTY\":{\"start\":{\"line\":46,\"col\":27,\"offset\":1590},\"end\":{\"line\":46,\"col\":31,\"offset\":1594},\"abstract_content\":\"form\"},\"$O\":{\"start\":{\"line\":49,\"col\":17,\"offset\":1682},\"end\":{\"line\":49,\"col\":23,\"offset\":1688},\"abstract_content\":\"cursor\"},\"$SINK\":{\"start\":{\"line\":49,\"col\":32,\"offset\":1697},\"end\":{\"line\":49,\"col\":35,\"offset\":1700},\"abstract_content\":\"sql\",\"propagated_value\":{\"svalue_start\":{\"line\":46,\"col\":19,\"offset\":1582},\"svalue_end\":{\"line\":46,\"col\":38,\"offset\":1601},\"svalue_abstract_content\":\"request.form['sql']\"}}},\"message\":\"Untrusted input might be used to build a database query, which can lead to a SQL injection vulnerability. An attacker can execute malicious SQL statements and gain unauthorized access to sensitive data, modify, delete data, or execute arbitrary system commands. To prevent this vulnerability, use prepared statements that do not concatenate user-controllable strings and use parameterized queries where SQL commands and user data are strictly separated. Also, consider using an object-relational (ORM) framework to operate with safer abstractions.\",\"metadata\":{\"likelihood\":\"HIGH\",\"impact\":\"HIGH\",\"confidence\":\"HIGH\",\"category\":\"security\",\"subcategory\":[\"vuln\"],\"cwe\":[\"CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')\"],\"cwe2020-top25\":true,\"cwe2021-top25\":true,\"cwe2022-top25\":true,\"display-name\":\"SQL Injection with prestodb via flask\",\"functional-categories\":[\"db::sink::sql-or-nosql-query::prestodb\",\"web::source::cookie::flask\",\"web::source::form-data::flask\",\"web::source::form-data::flask-wtf\",\"web::source::form-data::wtforms\",\"web::source::header::flask\",\"web::source::http-body::flask\",\"web::source::http-params::flask\",\"web::source::url-path-params::flask\"],\"owasp\":[\"A01:2017 - Injection\",\"A03:2021 - Injection\"],\"references\":[\"https://owasp.org/Top10/A03_2021-Injection\"],\"technology\":[\"flask\",\"flask-wtf\",\"prestodb\",\"python\",\"web\",\"wtforms\"],\"license\":\"Semgrep Rules License v1.0. For more details, visit semgrep.dev/legal/rules-license\",\"vulnerability_class\":[\"SQL Injection\"],\"source\":\"https://semgrep.dev/r/python.tars.flask.sql.prestodb.flask-prestodb-sqli.flask-prestodb-sqli\",\"shortlink\":\"https://sg.run/Ab2Y4\",\"semgrep.dev\":{\"rule\":{\"origin\":\"pro_rules\",\"r_id\":151050,\"rule_id\":\"qNU2nYq\",\"rv_id\":974114,\"url\":\"https://semgrep.dev/playground/r/kbTYe8A/python.tars.flask.sql.prestodb.flask-prestodb-sqli.flask-prestodb-sqli\",\"version_id\":\"kbTYe8A\"}}},\"severity\":\"ERROR\",\"fingerprint\":\"c707a7a8c1c44bf1b4460caeefe5febb977ac53dc883c7c310feb3faf39c7dca59c64330ec471754f350d004adf7eb7a8e93ddc54ba4df384fbd4eaf9c94b81a_0\",\"lines\":\" cursor.execute(sql)\",\"is_ignored\":false,\"validation_state\":\"NO_VALIDATOR\",\"dataflow_trace\":{\"taint_source\":[\"CliLoc\",[{\"path\":\"insecure-app/app.py\",\"start\":{\"line\":46,\"col\":19,\"offset\":1582},\"end\":{\"line\":46,\"col\":38,\"offset\":1601}},\"request.form['sql']\"]],\"intermediate_vars\":[{\"location\":{\"path\":\"insecure-app/app.py\",\"start\":{\"line\":46,\"col\":13,\"offset\":1576},\"end\":{\"line\":46,\"col\":16,\"offset\":1579}},\"content\":\"sql\"}],\"taint_sink\":[\"CliLoc\",[{\"path\":\"insecure-app/app.py\",\"start\":{\"line\":49,\"col\":32,\"offset\":1697},\"end\":{\"line\":49,\"col\":35,\"offset\":1700}},\"sql\"]]},\"engine_kind\":\"OSS\"}},{\"check_id\":\"python.tars.flask.sql.prestodb.flask-without-url-path-prestodb-sqli.flask-without-url-path-prestodb-sqli\",\"path\":\"insecure-app/app.py\",\"start\":{\"line\":49,\"col\":32,\"offset\":1697},\"end\":{\"line\":49,\"col\":35,\"offset\":1700},\"extra\":{\"metavars\":{\"$1\":{\"start\":{\"line\":1,\"col\":1,\"offset\":0},\"end\":{\"line\":1,\"col\":5,\"offset\":4},\"abstract_content\":\"form\"},\"$PROPERTY\":{\"start\":{\"line\":46,\"col\":27,\"offset\":1590},\"end\":{\"line\":46,\"col\":31,\"offset\":1594},\"abstract_content\":\"form\"},\"$O\":{\"start\":{\"line\":49,\"col\":17,\"offset\":1682},\"end\":{\"line\":49,\"col\":23,\"offset\":1688},\"abstract_content\":\"cursor\"},\"$SINK\":{\"start\":{\"line\":49,\"col\":32,\"offset\":1697},\"end\":{\"line\":49,\"col\":35,\"offset\":1700},\"abstract_content\":\"sql\",\"propagated_value\":{\"svalue_start\":{\"line\":46,\"col\":19,\"offset\":1582},\"svalue_end\":{\"line\":46,\"col\":38,\"offset\":1601},\"svalue_abstract_content\":\"request.form['sql']\"}}},\"message\":\"Untrusted input might be used to build a database query, which can lead to a SQL injection vulnerability. An attacker can execute malicious SQL statements and gain unauthorized access to sensitive data, modify, delete data, or execute arbitrary system commands. To prevent this vulnerability, use prepared statements that do not concatenate user-controllable strings and use parameterized queries where SQL commands and user data are strictly separated. Also, consider using an object-relational (ORM) framework to operate with safer abstractions.\",\"metadata\":{\"likelihood\":\"HIGH\",\"impact\":\"HIGH\",\"confidence\":\"HIGH\",\"category\":\"security\",\"subcategory\":[\"vuln\"],\"cwe\":[\"CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')\"],\"cwe2020-top25\":true,\"cwe2021-top25\":true,\"cwe2022-top25\":true,\"display-name\":\"SQL Injection with prestodb via flask-without-url-path\",\"functional-categories\":[\"db::sink::sql-or-nosql-query::prestodb\",\"web::source::cookie::flask\",\"web::source::form-data::flask\",\"web::source::form-data::flask-wtf\",\"web::source::form-data::wtforms\",\"web::source::header::flask\",\"web::source::http-body::flask\",\"web::source::http-params::flask\",\"web::source::url-path-params::flask\"],\"owasp\":[\"A01:2017 - Injection\",\"A03:2021 - Injection\"],\"references\":[\"https://owasp.org/Top10/A03_2021-Injection\"],\"technology\":[\"flask\",\"flask-wtf\",\"prestodb\",\"python\",\"web\",\"wtforms\"],\"license\":\"Semgrep Rules License v1.0. For more details, visit semgrep.dev/legal/rules-license\",\"vulnerability_class\":[\"SQL Injection\"],\"source\":\"https://semgrep.dev/r/python.tars.flask.sql.prestodb.flask-without-url-path-prestodb-sqli.flask-without-url-path-prestodb-sqli\",\"shortlink\":\"https://sg.run/BYXN5\",\"semgrep.dev\":{\"rule\":{\"origin\":\"pro_rules\",\"r_id\":151051,\"rule_id\":\"lBU4OQB\",\"rv_id\":974115,\"url\":\"https://semgrep.dev/playground/r/w8TKyGQ/python.tars.flask.sql.prestodb.flask-without-url-path-prestodb-sqli.flask-without-url-path-prestodb-sqli\",\"version_id\":\"w8TKyGQ\"}}},\"severity\":\"ERROR\",\"fingerprint\":\"d0e545872c07965feb05279b73bc6eac98db46912ddc00dbef6a08ed6b4e161fd03cc8ca02606d1350676ec9e34a6ec8d32f1fed8e31a2f8464ede46ceba1687_0\",\"lines\":\" cursor.execute(sql)\",\"is_ignored\":false,\"validation_state\":\"NO_VALIDATOR\",\"dataflow_trace\":{\"taint_source\":[\"CliLoc\",[{\"path\":\"insecure-app/app.py\",\"start\":{\"line\":46,\"col\":19,\"offset\":1582},\"end\":{\"line\":46,\"col\":38,\"offset\":1601}},\"request.form['sql']\"]],\"intermediate_vars\":[{\"location\":{\"path\":\"insecure-app/app.py\",\"start\":{\"line\":46,\"col\":13,\"offset\":1576},\"end\":{\"line\":46,\"col\":16,\"offset\":1579}},\"content\":\"sql\"}],\"taint_sink\":[\"CliLoc\",[{\"path\":\"insecure-app/app.py\",\"start\":{\"line\":49,\"col\":32,\"offset\":1697},\"end\":{\"line\":49,\"col\":35,\"offset\":1700}},\"sql\"]]},\"engine_kind\":\"OSS\"}},{\"check_id\":\"python.django.security.injection.ssrf.ssrf-injection-requests.ssrf-injection-requests\",\"path\":\"insecure-app/app.py\",\"start\":{\"line\":78,\"col\":13,\"offset\":2923},\"end\":{\"line\":83,\"col\":44,\"offset\":3154},\"extra\":{\"metavars\":{\"$FUNC\":{\"start\":{\"line\":15,\"col\":5,\"offset\":378},\"end\":{\"line\":15,\"col\":10,\"offset\":383},\"abstract_content\":\"index\"},\"$DATA\":{\"start\":{\"line\":78,\"col\":13,\"offset\":2923},\"end\":{\"line\":78,\"col\":16,\"offset\":2926},\"abstract_content\":\"url\"},\"$W\":{\"start\":{\"line\":78,\"col\":27,\"offset\":2937},\"end\":{\"line\":78,\"col\":31,\"offset\":2941},\"abstract_content\":\"form\"},\"$METHOD\":{\"start\":{\"line\":80,\"col\":37,\"offset\":3002},\"end\":{\"line\":80,\"col\":40,\"offset\":3005},\"abstract_content\":\"get\"}},\"message\":\"Data from request object is passed to a new server-side request. This could lead to a server-side request forgery (SSRF). To mitigate, ensure that schemes and hosts are validated against an allowlist, do not forward the response to the user, and ensure proper authentication and transport-layer security in the proxied request. See https://owasp.org/www-community/attacks/Server_Side_Request_Forgery to learn more about SSRF vulnerabilities.\",\"metadata\":{\"cwe\":[\"CWE-918: Server-Side Request Forgery (SSRF)\"],\"owasp\":[\"A10:2021 - Server-Side Request Forgery (SSRF)\"],\"references\":[\"https://owasp.org/www-community/attacks/Server_Side_Request_Forgery\"],\"category\":\"security\",\"technology\":[\"django\"],\"cwe2022-top25\":true,\"cwe2021-top25\":true,\"subcategory\":[\"vuln\"],\"likelihood\":\"MEDIUM\",\"impact\":\"HIGH\",\"confidence\":\"MEDIUM\",\"license\":\"Semgrep Rules License v1.0. For more details, visit semgrep.dev/legal/rules-license\",\"vulnerability_class\":[\"Server-Side Request Forgery (SSRF)\"],\"source\":\"https://semgrep.dev/r/python.django.security.injection.ssrf.ssrf-injection-requests.ssrf-injection-requests\",\"shortlink\":\"https://sg.run/YvY4\",\"semgrep.dev\":{\"rule\":{\"origin\":\"community\",\"r_id\":9514,\"rule_id\":\"j2UvEw\",\"rv_id\":946188,\"url\":\"https://semgrep.dev/playground/r/1QToK1Y/python.django.security.injection.ssrf.ssrf-injection-requests.ssrf-injection-requests\",\"version_id\":\"1QToK1Y\"}}},\"severity\":\"ERROR\",\"fingerprint\":\"fab6dfa09b05c5b55536041ea9183547a03254003da91e929744c051374c388e8d971e3ab4ca41e66fc7d1e22f889877016e2990bf9f711d2be4b13c8bc16fd6_0\",\"lines\":\" url = request.form['url']\\n try:\\n response = requests.get(url)\\n output = f\\\"SSRF Response: {response.text[:200]}\\\"\\n except Exception as e:\\n output = f\\\"SSRF Error: {e}\\\"\",\"is_ignored\":false,\"validation_state\":\"NO_VALIDATOR\",\"engine_kind\":\"OSS\"}},{\"check_id\":\"python.flask.security.injection.ssrf-requests.ssrf-requests\",\"path\":\"insecure-app/app.py\",\"start\":{\"line\":80,\"col\":28,\"offset\":2993},\"end\":{\"line\":80,\"col\":45,\"offset\":3010},\"extra\":{\"metavars\":{\"$INTERM\":{\"start\":{\"line\":78,\"col\":13,\"offset\":2923},\"end\":{\"line\":78,\"col\":16,\"offset\":2926},\"abstract_content\":\"url\"},\"$W\":{\"start\":{\"line\":78,\"col\":27,\"offset\":2937},\"end\":{\"line\":78,\"col\":31,\"offset\":2941},\"abstract_content\":\"form\"},\"$FUNC\":{\"start\":{\"line\":80,\"col\":37,\"offset\":3002},\"end\":{\"line\":80,\"col\":40,\"offset\":3005},\"abstract_content\":\"get\"}},\"message\":\"Data from request object is passed to a new server-side request. This could lead to a server-side request forgery (SSRF). To mitigate, ensure that schemes and hosts are validated against an allowlist, do not forward the response to the user, and ensure proper authentication and transport-layer security in the proxied request.\",\"metadata\":{\"cwe\":[\"CWE-918: Server-Side Request Forgery (SSRF)\"],\"owasp\":[\"A10:2021 - Server-Side Request Forgery (SSRF)\"],\"references\":[\"https://owasp.org/www-community/attacks/Server_Side_Request_Forgery\"],\"category\":\"security\",\"technology\":[\"flask\"],\"cwe2022-top25\":true,\"cwe2021-top25\":true,\"subcategory\":[\"vuln\"],\"likelihood\":\"MEDIUM\",\"impact\":\"HIGH\",\"confidence\":\"MEDIUM\",\"license\":\"Semgrep Rules License v1.0. For more details, visit semgrep.dev/legal/rules-license\",\"vulnerability_class\":[\"Server-Side Request Forgery (SSRF)\"],\"source\":\"https://semgrep.dev/r/python.flask.security.injection.ssrf-requests.ssrf-requests\",\"shortlink\":\"https://sg.run/J9LW\",\"semgrep.dev\":{\"rule\":{\"origin\":\"community\",\"r_id\":9546,\"rule_id\":\"WAUoRx\",\"rv_id\":946226,\"url\":\"https://semgrep.dev/playground/r/o5TZe8r/python.flask.security.injection.ssrf-requests.ssrf-requests\",\"version_id\":\"o5TZe8r\"}}},\"severity\":\"ERROR\",\"fingerprint\":\"4525c51704f25a76ff79dff00f116f744a0ee0e4df50661c6c0076b01455629a344469a5ba828e963fa20f78f9d8c8b632b49623a9ff9ef4ad241a301d1617e5_0\",\"lines\":\" response = requests.get(url)\",\"is_ignored\":false,\"validation_state\":\"NO_VALIDATOR\",\"engine_kind\":\"OSS\"}},{\"check_id\":\"python.flask.net.tainted-flask-http-request-requests.tainted-flask-http-request-requests\",\"path\":\"insecure-app/app.py\",\"start\":{\"line\":80,\"col\":41,\"offset\":3006},\"end\":{\"line\":80,\"col\":44,\"offset\":3009},\"extra\":{\"metavars\":{\"$1\":{\"start\":{\"line\":1,\"col\":1,\"offset\":0},\"end\":{\"line\":1,\"col\":5,\"offset\":4},\"abstract_content\":\"form\"},\"$PROPERTY\":{\"start\":{\"line\":78,\"col\":27,\"offset\":2937},\"end\":{\"line\":78,\"col\":31,\"offset\":2941},\"abstract_content\":\"form\"},\"$FUNC\":{\"start\":{\"line\":80,\"col\":37,\"offset\":3002},\"end\":{\"line\":80,\"col\":40,\"offset\":3005},\"abstract_content\":\"get\"},\"$URL\":{\"start\":{\"line\":80,\"col\":41,\"offset\":3006},\"end\":{\"line\":80,\"col\":44,\"offset\":3009},\"abstract_content\":\"url\",\"propagated_value\":{\"svalue_start\":{\"line\":78,\"col\":19,\"offset\":2929},\"svalue_end\":{\"line\":78,\"col\":38,\"offset\":2948},\"svalue_abstract_content\":\"request.form['url']\"}}},\"message\":\"Untrusted input might be used to build an HTTP request, which can lead to a Server-side request forgery (SSRF) vulnerability. SSRF allows an attacker to send crafted requests from the server side to other internal or external systems. SSRF can lead to unauthorized access to sensitive data and, in some cases, allow the attacker to control applications or systems that trust the vulnerable service. To prevent this vulnerability, avoid allowing user input to craft the base request. Instead, treat it as part of the path or query parameter and encode it appropriately. When user input is necessary to prepare the HTTP request, perform strict input validation. Additionally, whenever possible, use allowlists to only interact with expected, trusted domains.\",\"metadata\":{\"likelihood\":\"MEDIUM\",\"impact\":\"HIGH\",\"confidence\":\"MEDIUM\",\"category\":\"security\",\"subcategory\":[\"vuln\"],\"cwe\":[\"CWE-918: Server-Side Request Forgery (SSRF)\"],\"cwe2021-top25\":true,\"cwe2022-top25\":true,\"display-name\":\"Server-Side Request Forgery (SSRF) with Flask\",\"functional-categories\":[\"net::sink::http-request::requests\",\"web::source::cookie::flask\",\"web::source::form-data::flask\",\"web::source::form-data::flask-wtf\",\"web::source::form-data::wtforms\",\"web::source::header::flask\",\"web::source::http-body::flask\",\"web::source::http-params::flask\",\"web::source::url-path-params::flask\"],\"owasp\":[\"A10:2021 - Server-Side Request Forgery (SSRF)\"],\"references\":[\"https://owasp.org/Top10/A10_2021-Server-Side_Request_Forgery_%28SSRF%29\"],\"technology\":[\"flask\",\"flask-wtf\",\"requests\",\"web\",\"wtforms\"],\"license\":\"Semgrep Rules License v1.0. For more details, visit semgrep.dev/legal/rules-license\",\"vulnerability_class\":[\"Server-Side Request Forgery (SSRF)\"],\"source\":\"https://semgrep.dev/r/python.flask.net.tainted-flask-http-request-requests.tainted-flask-http-request-requests\",\"shortlink\":\"https://sg.run/109zk\",\"semgrep.dev\":{\"rule\":{\"origin\":\"pro_rules\",\"r_id\":116522,\"rule_id\":\"bwUbEzL\",\"rv_id\":947949,\"url\":\"https://semgrep.dev/playground/r/1QToZr7/python.flask.net.tainted-flask-http-request-requests.tainted-flask-http-request-requests\",\"version_id\":\"1QToZr7\"}}},\"severity\":\"ERROR\",\"fingerprint\":\"b9ea27fee0799df8f4a4afd40cbd61dccca7c131e69366e582ff71ce00d5e7e990fcb5adf0c4e4656360f9d85e36588e47e177df2cb2e179cb7417e68cdfb5f2_0\",\"lines\":\" response = requests.get(url)\",\"is_ignored\":false,\"validation_state\":\"NO_VALIDATOR\",\"dataflow_trace\":{\"taint_source\":[\"CliLoc\",[{\"path\":\"insecure-app/app.py\",\"start\":{\"line\":78,\"col\":19,\"offset\":2929},\"end\":{\"line\":78,\"col\":38,\"offset\":2948}},\"request.form['url']\"]],\"intermediate_vars\":[{\"location\":{\"path\":\"insecure-app/app.py\",\"start\":{\"line\":78,\"col\":13,\"offset\":2923},\"end\":{\"line\":78,\"col\":16,\"offset\":2926}},\"content\":\"url\"}],\"taint_sink\":[\"CliLoc\",[{\"path\":\"insecure-app/app.py\",\"start\":{\"line\":80,\"col\":41,\"offset\":3006},\"end\":{\"line\":80,\"col\":44,\"offset\":3009}},\"url\"]]},\"engine_kind\":\"OSS\"}},{\"check_id\":\"python.django.security.injection.sql.sql-injection-using-db-cursor-execute.sql-injection-db-cursor-execute\",\"path\":\"insecure-app/app.py\",\"start\":{\"line\":87,\"col\":13,\"offset\":3277},\"end\":{\"line\":98,\"col\":43,\"offset\":3811},\"extra\":{\"metavars\":{\"$FUNC\":{\"start\":{\"line\":15,\"col\":5,\"offset\":378},\"end\":{\"line\":15,\"col\":10,\"offset\":383},\"abstract_content\":\"index\"},\"$DATA\":{\"start\":{\"line\":87,\"col\":13,\"offset\":3277},\"end\":{\"line\":87,\"col\":21,\"offset\":3285},\"abstract_content\":\"username\"},\"$W\":{\"start\":{\"line\":87,\"col\":32,\"offset\":3296},\"end\":{\"line\":87,\"col\":36,\"offset\":3300},\"abstract_content\":\"form\"},\"$INTERM\":{\"start\":{\"line\":90,\"col\":17,\"offset\":3412},\"end\":{\"line\":90,\"col\":22,\"offset\":3417},\"abstract_content\":\"query\"},\"$STR\":{\"start\":{\"line\":90,\"col\":25,\"offset\":3420},\"end\":{\"line\":90,\"col\":75,\"offset\":3470},\"abstract_content\":\"\\\"SELECT password FROM users WHERE username = '{}'\\\"\"},\"$CURSOR\":{\"start\":{\"line\":91,\"col\":17,\"offset\":3504},\"end\":{\"line\":91,\"col\":23,\"offset\":3510},\"abstract_content\":\"cursor\"}},\"message\":\"User-controlled data from a request is passed to 'execute()'. This could lead to a SQL injection and therefore protected information could be leaked. Instead, use django's QuerySets, which are built with query parameterization and therefore not vulnerable to sql injection. For example, you could use `Entry.objects.filter(date=2006)`.\",\"metadata\":{\"cwe\":[\"CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')\"],\"owasp\":[\"A01:2017 - Injection\",\"A03:2021 - Injection\"],\"references\":[\"https://docs.djangoproject.com/en/3.0/topics/security/#sql-injection-protection\"],\"category\":\"security\",\"technology\":[\"django\"],\"cwe2022-top25\":true,\"cwe2021-top25\":true,\"subcategory\":[\"vuln\"],\"likelihood\":\"MEDIUM\",\"impact\":\"HIGH\",\"confidence\":\"MEDIUM\",\"license\":\"Semgrep Rules License v1.0. For more details, visit semgrep.dev/legal/rules-license\",\"vulnerability_class\":[\"SQL Injection\"],\"source\":\"https://semgrep.dev/r/python.django.security.injection.sql.sql-injection-using-db-cursor-execute.sql-injection-db-cursor-execute\",\"shortlink\":\"https://sg.run/qx7y\",\"semgrep.dev\":{\"rule\":{\"origin\":\"community\",\"r_id\":9512,\"rule_id\":\"2ZUbDL\",\"rv_id\":946186,\"url\":\"https://semgrep.dev/playground/r/X0TL8rA/python.django.security.injection.sql.sql-injection-using-db-cursor-execute.sql-injection-db-cursor-execute\",\"version_id\":\"X0TL8rA\"}}},\"severity\":\"WARNING\",\"fingerprint\":\"7de13c47abcf430754420a48d341c9be3f7c9616b721a91fad2547e88f3a1ec7f778a8689a2d00e9752f224332372edb09cec074030cc5031feadeaf9c42e487_0\",\"lines\":\" username = request.form['username']\\n try:\\n # Vulnerable SQL query using string interpolation\\n query = \\\"SELECT password FROM users WHERE username = '{}'\\\".format(username)\\n cursor.execute(query)\\n result = cursor.fetchone()\\n if result:\\n output = f\\\"Password for {username}: {result[0]}\\\"\\n else:\\n output = \\\"User not found.\\\"\\n except Exception as e:\\n output = f\\\"SQL Error: {e}\\\"\",\"is_ignored\":false,\"validation_state\":\"NO_VALIDATOR\",\"engine_kind\":\"OSS\"}},{\"check_id\":\"python.django.security.injection.tainted-sql-string.tainted-sql-string\",\"path\":\"insecure-app/app.py\",\"start\":{\"line\":90,\"col\":25,\"offset\":3420},\"end\":{\"line\":90,\"col\":92,\"offset\":3487},\"extra\":{\"metavars\":{\"$1\":{\"start\":{\"line\":1,\"col\":1,\"offset\":0},\"end\":{\"line\":1,\"col\":7,\"offset\":6},\"abstract_content\":\"SELECT\"},\"$ANYTHING\":{\"start\":{\"line\":87,\"col\":32,\"offset\":3296},\"end\":{\"line\":87,\"col\":36,\"offset\":3300},\"abstract_content\":\"form\"},\"$SQLSTR\":{\"start\":{\"line\":90,\"col\":26,\"offset\":3421},\"end\":{\"line\":90,\"col\":74,\"offset\":3469},\"abstract_content\":\"SELECT password FROM users WHERE username = '{}'\"}},\"message\":\"Detected user input used to manually construct a SQL string. This is usually bad practice because manual construction could accidentally result in a SQL injection. An attacker could use a SQL injection to steal or modify contents of the database. Instead, use a parameterized query which is available by default in most database engines. Alternatively, consider using the Django object-relational mappers (ORM) instead of raw SQL queries.\",\"metadata\":{\"cwe\":[\"CWE-915: Improperly Controlled Modification of Dynamically-Determined Object Attributes\"],\"owasp\":[\"A08:2021 - Software and Data Integrity Failures\"],\"references\":[\"https://docs.djangoproject.com/en/3.0/topics/security/#sql-injection-protection\"],\"category\":\"security\",\"technology\":[\"django\"],\"subcategory\":[\"audit\"],\"impact\":\"LOW\",\"likelihood\":\"MEDIUM\",\"confidence\":\"LOW\",\"license\":\"Semgrep Rules License v1.0. For more details, visit semgrep.dev/legal/rules-license\",\"vulnerability_class\":[\"Mass Assignment\"],\"source\":\"https://semgrep.dev/r/python.django.security.injection.tainted-sql-string.tainted-sql-string\",\"shortlink\":\"https://sg.run/PbZp\",\"semgrep.dev\":{\"rule\":{\"origin\":\"community\",\"r_id\":14701,\"rule_id\":\"lBU8Ad\",\"rv_id\":946190,\"url\":\"https://semgrep.dev/playground/r/yeT0nKx/python.django.security.injection.tainted-sql-string.tainted-sql-string\",\"version_id\":\"yeT0nKx\"}}},\"severity\":\"ERROR\",\"fingerprint\":\"131b5e7e7d2ac6fc49fe8d7468f54e651a09d4a4706cdea3961e2fa888007b16999046aff46b29fadd3e0fa30f6ae43e0b461b4ae3bf39a7323b33e3c32d2ff8_0\",\"lines\":\" query = \\\"SELECT password FROM users WHERE username = '{}'\\\".format(username)\",\"is_ignored\":false,\"validation_state\":\"NO_VALIDATOR\",\"dataflow_trace\":{\"taint_source\":[\"CliLoc\",[{\"path\":\"insecure-app/app.py\",\"start\":{\"line\":87,\"col\":24,\"offset\":3288},\"end\":{\"line\":87,\"col\":36,\"offset\":3300}},\"request.form\"]],\"intermediate_vars\":[{\"location\":{\"path\":\"insecure-app/app.py\",\"start\":{\"line\":87,\"col\":13,\"offset\":3277},\"end\":{\"line\":87,\"col\":21,\"offset\":3285}},\"content\":\"username\"}],\"taint_sink\":[\"CliLoc\",[{\"path\":\"insecure-app/app.py\",\"start\":{\"line\":90,\"col\":25,\"offset\":3420},\"end\":{\"line\":90,\"col\":92,\"offset\":3487}},\"\\\"SELECT password FROM users WHERE username = '{}'\\\".format(username)\"]]},\"engine_kind\":\"OSS\"}},{\"check_id\":\"python.flask.security.injection.tainted-sql-string.tainted-sql-string\",\"path\":\"insecure-app/app.py\",\"start\":{\"line\":90,\"col\":25,\"offset\":3420},\"end\":{\"line\":90,\"col\":92,\"offset\":3487},\"extra\":{\"metavars\":{\"$1\":{\"start\":{\"line\":1,\"col\":1,\"offset\":0},\"end\":{\"line\":1,\"col\":7,\"offset\":6},\"abstract_content\":\"SELECT\"},\"$ANYTHING\":{\"start\":{\"line\":87,\"col\":32,\"offset\":3296},\"end\":{\"line\":87,\"col\":36,\"offset\":3300},\"abstract_content\":\"form\"},\"$SQLSTR\":{\"start\":{\"line\":90,\"col\":26,\"offset\":3421},\"end\":{\"line\":90,\"col\":74,\"offset\":3469},\"abstract_content\":\"SELECT password FROM users WHERE username = '{}'\"}},\"message\":\"Detected user input used to manually construct a SQL string. This is usually bad practice because manual construction could accidentally result in a SQL injection. An attacker could use a SQL injection to steal or modify contents of the database. Instead, use a parameterized query which is available by default in most database engines. Alternatively, consider using an object-relational mapper (ORM) such as SQLAlchemy which will protect your queries.\",\"metadata\":{\"cwe\":[\"CWE-704: Incorrect Type Conversion or Cast\"],\"owasp\":[\"A01:2017 - Injection\",\"A03:2021 - Injection\"],\"references\":[\"https://docs.sqlalchemy.org/en/14/core/tutorial.html#using-textual-sql\",\"https://www.tutorialspoint.com/sqlalchemy/sqlalchemy_quick_guide.htm\",\"https://docs.sqlalchemy.org/en/14/core/tutorial.html#using-more-specific-text-with-table-expression-literal-column-and-expression-column\"],\"category\":\"security\",\"technology\":[\"sqlalchemy\",\"flask\"],\"subcategory\":[\"vuln\"],\"impact\":\"MEDIUM\",\"likelihood\":\"MEDIUM\",\"confidence\":\"MEDIUM\",\"license\":\"Semgrep Rules License v1.0. For more details, visit semgrep.dev/legal/rules-license\",\"vulnerability_class\":[\"Improper Validation\"],\"source\":\"https://semgrep.dev/r/python.flask.security.injection.tainted-sql-string.tainted-sql-string\",\"shortlink\":\"https://sg.run/JxZj\",\"semgrep.dev\":{\"rule\":{\"origin\":\"community\",\"r_id\":14702,\"rule_id\":\"YGUDKQ\",\"rv_id\":946228,\"url\":\"https://semgrep.dev/playground/r/pZTNO7z/python.flask.security.injection.tainted-sql-string.tainted-sql-string\",\"version_id\":\"pZTNO7z\"}}},\"severity\":\"ERROR\",\"fingerprint\":\"d78139633035de6bf1b9a560172a84f789b9ddd923facc66df7a193b8e313841e015366f2216bfa6d2a311380594d28e7b5da825a9eaeabb73bf9613adbdb29d_0\",\"lines\":\" query = \\\"SELECT password FROM users WHERE username = '{}'\\\".format(username)\",\"is_ignored\":false,\"validation_state\":\"NO_VALIDATOR\",\"dataflow_trace\":{\"taint_source\":[\"CliLoc\",[{\"path\":\"insecure-app/app.py\",\"start\":{\"line\":87,\"col\":24,\"offset\":3288},\"end\":{\"line\":87,\"col\":36,\"offset\":3300}},\"request.form\"]],\"intermediate_vars\":[{\"location\":{\"path\":\"insecure-app/app.py\",\"start\":{\"line\":87,\"col\":13,\"offset\":3277},\"end\":{\"line\":87,\"col\":21,\"offset\":3285}},\"content\":\"username\"}],\"taint_sink\":[\"CliLoc\",[{\"path\":\"insecure-app/app.py\",\"start\":{\"line\":90,\"col\":25,\"offset\":3420},\"end\":{\"line\":90,\"col\":92,\"offset\":3487}},\"\\\"SELECT password FROM users WHERE username = '{}'\\\".format(username)\"]]},\"engine_kind\":\"OSS\"}},{\"check_id\":\"python.lang.security.audit.formatted-sql-query.formatted-sql-query\",\"path\":\"insecure-app/app.py\",\"start\":{\"line\":91,\"col\":17,\"offset\":3504},\"end\":{\"line\":91,\"col\":38,\"offset\":3525},\"extra\":{\"metavars\":{\"$DB\":{\"start\":{\"line\":91,\"col\":17,\"offset\":3504},\"end\":{\"line\":91,\"col\":23,\"offset\":3510},\"abstract_content\":\"cursor\"},\"$SQL\":{\"start\":{\"line\":91,\"col\":32,\"offset\":3519},\"end\":{\"line\":91,\"col\":37,\"offset\":3524},\"abstract_content\":\"query\",\"propagated_value\":{\"svalue_start\":{\"line\":90,\"col\":25,\"offset\":3420},\"svalue_end\":{\"line\":90,\"col\":92,\"offset\":3487},\"svalue_abstract_content\":\"\\\"SELECT password FROM users WHERE username = '{}'\\\".format(username)\"}}},\"message\":\"Detected possible formatted SQL query. Use parameterized queries instead.\",\"metadata\":{\"owasp\":[\"A01:2017 - Injection\",\"A03:2021 - Injection\"],\"cwe\":[\"CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')\"],\"references\":[\"https://stackoverflow.com/questions/775296/mysql-parameterized-queries\"],\"category\":\"security\",\"technology\":[\"python\"],\"cwe2022-top25\":true,\"cwe2021-top25\":true,\"subcategory\":[\"audit\"],\"likelihood\":\"LOW\",\"impact\":\"HIGH\",\"confidence\":\"LOW\",\"license\":\"Semgrep Rules License v1.0. For more details, visit semgrep.dev/legal/rules-license\",\"vulnerability_class\":[\"SQL Injection\"],\"source\":\"https://semgrep.dev/r/python.lang.security.audit.formatted-sql-query.formatted-sql-query\",\"shortlink\":\"https://sg.run/EkWw\",\"semgrep.dev\":{\"rule\":{\"origin\":\"community\",\"r_id\":9637,\"rule_id\":\"3qUP9k\",\"rv_id\":946343,\"url\":\"https://semgrep.dev/playground/r/e1T98KK/python.lang.security.audit.formatted-sql-query.formatted-sql-query\",\"version_id\":\"e1T98KK\"}}},\"severity\":\"WARNING\",\"fingerprint\":\"a74600ac310bdab04cc5ea8c2e7c25221703979f0286dde9018a90d2dbd6c16ea381c5d4f9cb97fbcac0b0aeef454a63c3f82f078d6fa9512358b6566e5263a3_0\",\"lines\":\" cursor.execute(query)\",\"is_ignored\":false,\"validation_state\":\"NO_VALIDATOR\",\"engine_kind\":\"OSS\"}},{\"check_id\":\"python.sqlalchemy.security.sqlalchemy-execute-raw-query.sqlalchemy-execute-raw-query\",\"path\":\"insecure-app/app.py\",\"start\":{\"line\":91,\"col\":17,\"offset\":3504},\"end\":{\"line\":91,\"col\":38,\"offset\":3525},\"extra\":{\"metavars\":{\"$SQL\":{\"start\":{\"line\":90,\"col\":25,\"offset\":3420},\"end\":{\"line\":90,\"col\":75,\"offset\":3470},\"abstract_content\":\"\\\"SELECT password FROM users WHERE username = '{}'\\\"\"},\"$CONNECTION\":{\"start\":{\"line\":91,\"col\":17,\"offset\":3504},\"end\":{\"line\":91,\"col\":23,\"offset\":3510},\"abstract_content\":\"cursor\"},\"$QUERY\":{\"start\":{\"line\":91,\"col\":32,\"offset\":3519},\"end\":{\"line\":91,\"col\":37,\"offset\":3524},\"abstract_content\":\"query\",\"propagated_value\":{\"svalue_start\":{\"line\":90,\"col\":25,\"offset\":3420},\"svalue_end\":{\"line\":90,\"col\":92,\"offset\":3487},\"svalue_abstract_content\":\"\\\"SELECT password FROM users WHERE username = '{}'\\\".format(username)\"}}},\"message\":\"Avoiding SQL string concatenation: untrusted input concatenated with raw SQL query can result in SQL Injection. In order to execute raw query safely, prepared statement should be used. SQLAlchemy provides TextualSQL to easily used prepared statement with named parameters. For complex SQL composition, use SQL Expression Language or Schema Definition Language. In most cases, SQLAlchemy ORM will be a better option.\",\"metadata\":{\"cwe\":[\"CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')\"],\"owasp\":[\"A01:2017 - Injection\",\"A03:2021 - Injection\"],\"references\":[\"https://docs.sqlalchemy.org/en/14/core/tutorial.html#using-textual-sql\",\"https://www.tutorialspoint.com/sqlalchemy/sqlalchemy_quick_guide.htm\",\"https://docs.sqlalchemy.org/en/14/core/tutorial.html#using-more-specific-text-with-table-expression-literal-column-and-expression-column\"],\"category\":\"security\",\"technology\":[\"sqlalchemy\"],\"cwe2022-top25\":true,\"cwe2021-top25\":true,\"subcategory\":[\"audit\"],\"likelihood\":\"LOW\",\"impact\":\"HIGH\",\"confidence\":\"LOW\",\"license\":\"Semgrep Rules License v1.0. For more details, visit semgrep.dev/legal/rules-license\",\"vulnerability_class\":[\"SQL Injection\"],\"source\":\"https://semgrep.dev/r/python.sqlalchemy.security.sqlalchemy-execute-raw-query.sqlalchemy-execute-raw-query\",\"shortlink\":\"https://sg.run/2b1L\",\"semgrep.dev\":{\"rule\":{\"origin\":\"community\",\"r_id\":10563,\"rule_id\":\"oqUz5y\",\"rv_id\":946452,\"url\":\"https://semgrep.dev/playground/r/8KTKj19/python.sqlalchemy.security.sqlalchemy-execute-raw-query.sqlalchemy-execute-raw-query\",\"version_id\":\"8KTKj19\"}}},\"severity\":\"ERROR\",\"fingerprint\":\"97cb38d9b784f2ccc9d408311b424efd2db86f21a63023679b620bdd2800fa8befdbbd093b704ba25840091646bc7b85382022dc1d4d980c88b5252c8720390a_0\",\"lines\":\" cursor.execute(query)\",\"is_ignored\":false,\"validation_state\":\"NO_VALIDATOR\",\"engine_kind\":\"OSS\"}},{\"check_id\":\"python.flask.db.generic-sql-flask.generic-sql-flask\",\"path\":\"insecure-app/app.py\",\"start\":{\"line\":91,\"col\":32,\"offset\":3519},\"end\":{\"line\":91,\"col\":37,\"offset\":3524},\"extra\":{\"metavars\":{\"$1\":{\"start\":{\"line\":1,\"col\":1,\"offset\":0},\"end\":{\"line\":1,\"col\":5,\"offset\":4},\"abstract_content\":\"form\"},\"$PROPERTY\":{\"start\":{\"line\":87,\"col\":32,\"offset\":3296},\"end\":{\"line\":87,\"col\":36,\"offset\":3300},\"abstract_content\":\"form\"},\"$AIOMYSQL_CURSOR\":{\"start\":{\"line\":91,\"col\":17,\"offset\":3504},\"end\":{\"line\":91,\"col\":23,\"offset\":3510},\"abstract_content\":\"cursor\"},\"$SINK\":{\"start\":{\"line\":91,\"col\":32,\"offset\":3519},\"end\":{\"line\":91,\"col\":37,\"offset\":3524},\"abstract_content\":\"query\",\"propagated_value\":{\"svalue_start\":{\"line\":90,\"col\":25,\"offset\":3420},\"svalue_end\":{\"line\":90,\"col\":92,\"offset\":3487},\"svalue_abstract_content\":\"\\\"SELECT password FROM users WHERE username = '{}'\\\".format(username)\"}}},\"message\":\"Untrusted input might be used to build a database query, which can lead to a SQL injection vulnerability. An attacker can execute malicious SQL statements and gain unauthorized access to sensitive data, modify, delete data, or execute arbitrary system commands. The driver API has the ability to bind parameters to the query in a safe way. Make sure not to dynamically create SQL queries from user-influenced inputs. If you cannot avoid this, either escape the data properly or create an allowlist to check the value.\",\"metadata\":{\"likelihood\":\"HIGH\",\"impact\":\"HIGH\",\"confidence\":\"HIGH\",\"category\":\"security\",\"subcategory\":[\"vuln\"],\"cwe\":[\"CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')\"],\"cwe2020-top25\":true,\"cwe2021-top25\":true,\"cwe2022-top25\":true,\"display-name\":\"SQL Injection with Flask\",\"functional-categories\":[\"db::sink::sql-or-nosql-query::aiomysql\",\"db::sink::sql-or-nosql-query::aiopg\",\"db::sink::sql-or-nosql-query::mysql-connector\",\"db::sink::sql-or-nosql-query::mysqldb\",\"db::sink::sql-or-nosql-query::pep249\",\"db::sink::sql-or-nosql-query::psycopg2\",\"db::sink::sql-or-nosql-query::pymssql\",\"db::sink::sql-or-nosql-query::pymysql\",\"db::sink::sql-or-nosql-query::pyodbc\",\"web::source::cookie::flask\",\"web::source::form-data::flask\",\"web::source::form-data::flask-wtf\",\"web::source::form-data::wtforms\",\"web::source::header::flask\",\"web::source::http-body::flask\",\"web::source::http-params::flask\",\"web::source::url-path-params::flask\"],\"owasp\":[\"A01:2017 - Injection\",\"A03:2021 - Injection\"],\"references\":[\"https://owasp.org/Top10/A03_2021-Injection\"],\"technology\":[\"aiomysql\",\"aiopg\",\"db-api\",\"flask\",\"flask-wtf\",\"mssql\",\"mysql\",\"mysql-connector\",\"mysqldb\",\"pep249\",\"postgres\",\"psycopg2\",\"pymssql\",\"pymysql\",\"pyodbc\",\"sql\",\"web\",\"wtforms\"],\"license\":\"Semgrep Rules License v1.0. For more details, visit semgrep.dev/legal/rules-license\",\"vulnerability_class\":[\"SQL Injection\"],\"source\":\"https://semgrep.dev/r/python.flask.db.generic-sql-flask.generic-sql-flask\",\"shortlink\":\"https://sg.run/AbKXQ\",\"semgrep.dev\":{\"rule\":{\"origin\":\"pro_rules\",\"r_id\":116506,\"rule_id\":\"0oULG2d\",\"rv_id\":947908,\"url\":\"https://semgrep.dev/playground/r/rxT6kpn/python.flask.db.generic-sql-flask.generic-sql-flask\",\"version_id\":\"rxT6kpn\"}}},\"severity\":\"ERROR\",\"fingerprint\":\"a80f7e2b4c23589f94ab602f17de0c81936ee0e90bae9e1716a1ceca152f7466301e0b6af164ffe2e311facac9f4f61b278c6c1c47ef1e2e07fce41c0042a588_0\",\"lines\":\" cursor.execute(query)\",\"is_ignored\":false,\"validation_state\":\"NO_VALIDATOR\",\"dataflow_trace\":{\"taint_source\":[\"CliLoc\",[{\"path\":\"insecure-app/app.py\",\"start\":{\"line\":87,\"col\":24,\"offset\":3288},\"end\":{\"line\":87,\"col\":48,\"offset\":3312}},\"request.form['username']\"]],\"intermediate_vars\":[{\"location\":{\"path\":\"insecure-app/app.py\",\"start\":{\"line\":87,\"col\":13,\"offset\":3277},\"end\":{\"line\":87,\"col\":21,\"offset\":3285}},\"content\":\"username\"},{\"location\":{\"path\":\"insecure-app/app.py\",\"start\":{\"line\":90,\"col\":17,\"offset\":3412},\"end\":{\"line\":90,\"col\":22,\"offset\":3417}},\"content\":\"query\"}],\"taint_sink\":[\"CliLoc\",[{\"path\":\"insecure-app/app.py\",\"start\":{\"line\":91,\"col\":32,\"offset\":3519},\"end\":{\"line\":91,\"col\":37,\"offset\":3524}},\"query\"]]},\"engine_kind\":\"OSS\"}},{\"check_id\":\"python.tars.flask.sql.prestodb.flask-prestodb-sqli.flask-prestodb-sqli\",\"path\":\"insecure-app/app.py\",\"start\":{\"line\":91,\"col\":32,\"offset\":3519},\"end\":{\"line\":91,\"col\":37,\"offset\":3524},\"extra\":{\"metavars\":{\"$1\":{\"start\":{\"line\":1,\"col\":1,\"offset\":0},\"end\":{\"line\":1,\"col\":5,\"offset\":4},\"abstract_content\":\"form\"},\"$PROPERTY\":{\"start\":{\"line\":87,\"col\":32,\"offset\":3296},\"end\":{\"line\":87,\"col\":36,\"offset\":3300},\"abstract_content\":\"form\"},\"$O\":{\"start\":{\"line\":91,\"col\":17,\"offset\":3504},\"end\":{\"line\":91,\"col\":23,\"offset\":3510},\"abstract_content\":\"cursor\"},\"$SINK\":{\"start\":{\"line\":91,\"col\":32,\"offset\":3519},\"end\":{\"line\":91,\"col\":37,\"offset\":3524},\"abstract_content\":\"query\",\"propagated_value\":{\"svalue_start\":{\"line\":90,\"col\":25,\"offset\":3420},\"svalue_end\":{\"line\":90,\"col\":92,\"offset\":3487},\"svalue_abstract_content\":\"\\\"SELECT password FROM users WHERE username = '{}'\\\".format(username)\"}}},\"message\":\"Untrusted input might be used to build a database query, which can lead to a SQL injection vulnerability. An attacker can execute malicious SQL statements and gain unauthorized access to sensitive data, modify, delete data, or execute arbitrary system commands. To prevent this vulnerability, use prepared statements that do not concatenate user-controllable strings and use parameterized queries where SQL commands and user data are strictly separated. Also, consider using an object-relational (ORM) framework to operate with safer abstractions.\",\"metadata\":{\"likelihood\":\"HIGH\",\"impact\":\"HIGH\",\"confidence\":\"HIGH\",\"category\":\"security\",\"subcategory\":[\"vuln\"],\"cwe\":[\"CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')\"],\"cwe2020-top25\":true,\"cwe2021-top25\":true,\"cwe2022-top25\":true,\"display-name\":\"SQL Injection with prestodb via flask\",\"functional-categories\":[\"db::sink::sql-or-nosql-query::prestodb\",\"web::source::cookie::flask\",\"web::source::form-data::flask\",\"web::source::form-data::flask-wtf\",\"web::source::form-data::wtforms\",\"web::source::header::flask\",\"web::source::http-body::flask\",\"web::source::http-params::flask\",\"web::source::url-path-params::flask\"],\"owasp\":[\"A01:2017 - Injection\",\"A03:2021 - Injection\"],\"references\":[\"https://owasp.org/Top10/A03_2021-Injection\"],\"technology\":[\"flask\",\"flask-wtf\",\"prestodb\",\"python\",\"web\",\"wtforms\"],\"license\":\"Semgrep Rules License v1.0. For more details, visit semgrep.dev/legal/rules-license\",\"vulnerability_class\":[\"SQL Injection\"],\"source\":\"https://semgrep.dev/r/python.tars.flask.sql.prestodb.flask-prestodb-sqli.flask-prestodb-sqli\",\"shortlink\":\"https://sg.run/Ab2Y4\",\"semgrep.dev\":{\"rule\":{\"origin\":\"pro_rules\",\"r_id\":151050,\"rule_id\":\"qNU2nYq\",\"rv_id\":974114,\"url\":\"https://semgrep.dev/playground/r/kbTYe8A/python.tars.flask.sql.prestodb.flask-prestodb-sqli.flask-prestodb-sqli\",\"version_id\":\"kbTYe8A\"}}},\"severity\":\"ERROR\",\"fingerprint\":\"d775a8b630cffbbe8eca881c9cfcdb41f1712b6b4725bd2eff0e62d0a2a62a2d7dd68d3d0f894ebc17c9eac9ae138a5d02473baf772d07f06ff34bb0f87a7b60_0\",\"lines\":\" cursor.execute(query)\",\"is_ignored\":false,\"validation_state\":\"NO_VALIDATOR\",\"dataflow_trace\":{\"taint_source\":[\"CliLoc\",[{\"path\":\"insecure-app/app.py\",\"start\":{\"line\":87,\"col\":24,\"offset\":3288},\"end\":{\"line\":87,\"col\":48,\"offset\":3312}},\"request.form['username']\"]],\"intermediate_vars\":[{\"location\":{\"path\":\"insecure-app/app.py\",\"start\":{\"line\":87,\"col\":13,\"offset\":3277},\"end\":{\"line\":87,\"col\":21,\"offset\":3285}},\"content\":\"username\"},{\"location\":{\"path\":\"insecure-app/app.py\",\"start\":{\"line\":90,\"col\":17,\"offset\":3412},\"end\":{\"line\":90,\"col\":22,\"offset\":3417}},\"content\":\"query\"}],\"taint_sink\":[\"CliLoc\",[{\"path\":\"insecure-app/app.py\",\"start\":{\"line\":91,\"col\":32,\"offset\":3519},\"end\":{\"line\":91,\"col\":37,\"offset\":3524}},\"query\"]]},\"engine_kind\":\"OSS\"}},{\"check_id\":\"python.tars.flask.sql.prestodb.flask-without-url-path-prestodb-sqli.flask-without-url-path-prestodb-sqli\",\"path\":\"insecure-app/app.py\",\"start\":{\"line\":91,\"col\":32,\"offset\":3519},\"end\":{\"line\":91,\"col\":37,\"offset\":3524},\"extra\":{\"metavars\":{\"$1\":{\"start\":{\"line\":1,\"col\":1,\"offset\":0},\"end\":{\"line\":1,\"col\":5,\"offset\":4},\"abstract_content\":\"form\"},\"$PROPERTY\":{\"start\":{\"line\":87,\"col\":32,\"offset\":3296},\"end\":{\"line\":87,\"col\":36,\"offset\":3300},\"abstract_content\":\"form\"},\"$O\":{\"start\":{\"line\":91,\"col\":17,\"offset\":3504},\"end\":{\"line\":91,\"col\":23,\"offset\":3510},\"abstract_content\":\"cursor\"},\"$SINK\":{\"start\":{\"line\":91,\"col\":32,\"offset\":3519},\"end\":{\"line\":91,\"col\":37,\"offset\":3524},\"abstract_content\":\"query\",\"propagated_value\":{\"svalue_start\":{\"line\":90,\"col\":25,\"offset\":3420},\"svalue_end\":{\"line\":90,\"col\":92,\"offset\":3487},\"svalue_abstract_content\":\"\\\"SELECT password FROM users WHERE username = '{}'\\\".format(username)\"}}},\"message\":\"Untrusted input might be used to build a database query, which can lead to a SQL injection vulnerability. An attacker can execute malicious SQL statements and gain unauthorized access to sensitive data, modify, delete data, or execute arbitrary system commands. To prevent this vulnerability, use prepared statements that do not concatenate user-controllable strings and use parameterized queries where SQL commands and user data are strictly separated. Also, consider using an object-relational (ORM) framework to operate with safer abstractions.\",\"metadata\":{\"likelihood\":\"HIGH\",\"impact\":\"HIGH\",\"confidence\":\"HIGH\",\"category\":\"security\",\"subcategory\":[\"vuln\"],\"cwe\":[\"CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')\"],\"cwe2020-top25\":true,\"cwe2021-top25\":true,\"cwe2022-top25\":true,\"display-name\":\"SQL Injection with prestodb via flask-without-url-path\",\"functional-categories\":[\"db::sink::sql-or-nosql-query::prestodb\",\"web::source::cookie::flask\",\"web::source::form-data::flask\",\"web::source::form-data::flask-wtf\",\"web::source::form-data::wtforms\",\"web::source::header::flask\",\"web::source::http-body::flask\",\"web::source::http-params::flask\",\"web::source::url-path-params::flask\"],\"owasp\":[\"A01:2017 - Injection\",\"A03:2021 - Injection\"],\"references\":[\"https://owasp.org/Top10/A03_2021-Injection\"],\"technology\":[\"flask\",\"flask-wtf\",\"prestodb\",\"python\",\"web\",\"wtforms\"],\"license\":\"Semgrep Rules License v1.0. For more details, visit semgrep.dev/legal/rules-license\",\"vulnerability_class\":[\"SQL Injection\"],\"source\":\"https://semgrep.dev/r/python.tars.flask.sql.prestodb.flask-without-url-path-prestodb-sqli.flask-without-url-path-prestodb-sqli\",\"shortlink\":\"https://sg.run/BYXN5\",\"semgrep.dev\":{\"rule\":{\"origin\":\"pro_rules\",\"r_id\":151051,\"rule_id\":\"lBU4OQB\",\"rv_id\":974115,\"url\":\"https://semgrep.dev/playground/r/w8TKyGQ/python.tars.flask.sql.prestodb.flask-without-url-path-prestodb-sqli.flask-without-url-path-prestodb-sqli\",\"version_id\":\"w8TKyGQ\"}}},\"severity\":\"ERROR\",\"fingerprint\":\"3b031ef816c35b352f70682b3f4b652864376d5a11968a80b3f91b46993f639a7a3fb6cae975a6fe9eea99a57629691ca54b76eb0a7433160e96197f9a646858_0\",\"lines\":\" cursor.execute(query)\",\"is_ignored\":false,\"validation_state\":\"NO_VALIDATOR\",\"dataflow_trace\":{\"taint_source\":[\"CliLoc\",[{\"path\":\"insecure-app/app.py\",\"start\":{\"line\":87,\"col\":24,\"offset\":3288},\"end\":{\"line\":87,\"col\":48,\"offset\":3312}},\"request.form['username']\"]],\"intermediate_vars\":[{\"location\":{\"path\":\"insecure-app/app.py\",\"start\":{\"line\":87,\"col\":13,\"offset\":3277},\"end\":{\"line\":87,\"col\":21,\"offset\":3285}},\"content\":\"username\"},{\"location\":{\"path\":\"insecure-app/app.py\",\"start\":{\"line\":90,\"col\":17,\"offset\":3412},\"end\":{\"line\":90,\"col\":22,\"offset\":3417}},\"content\":\"query\"}],\"taint_sink\":[\"CliLoc\",[{\"path\":\"insecure-app/app.py\",\"start\":{\"line\":91,\"col\":32,\"offset\":3519},\"end\":{\"line\":91,\"col\":37,\"offset\":3524}},\"query\"]]},\"engine_kind\":\"OSS\"}},{\"check_id\":\"python.flask.security.audit.render-template-string.render-template-string\",\"path\":\"insecure-app/app.py\",\"start\":{\"line\":100,\"col\":12,\"offset\":3824},\"end\":{\"line\":165,\"col\":24,\"offset\":6152},\"extra\":{\"metavars\":{},\"message\":\"Found a template created with string formatting. This is susceptible to server-side template injection and cross-site scripting attacks.\",\"metadata\":{\"cwe\":[\"CWE-96: Improper Neutralization of Directives in Statically Saved Code ('Static Code Injection')\"],\"owasp\":[\"A03:2021 - Injection\"],\"references\":[\"https://nvisium.com/blog/2016/03/09/exploring-ssti-in-flask-jinja2.html\"],\"category\":\"security\",\"technology\":[\"flask\"],\"subcategory\":[\"audit\"],\"likelihood\":\"LOW\",\"impact\":\"MEDIUM\",\"confidence\":\"LOW\",\"license\":\"Semgrep Rules License v1.0. For more details, visit semgrep.dev/legal/rules-license\",\"vulnerability_class\":[\"Code Injection\"],\"source\":\"https://semgrep.dev/r/python.flask.security.audit.render-template-string.render-template-string\",\"shortlink\":\"https://sg.run/8yjE\",\"semgrep.dev\":{\"rule\":{\"origin\":\"community\",\"r_id\":9540,\"rule_id\":\"5rUOv1\",\"rv_id\":946214,\"url\":\"https://semgrep.dev/playground/r/GxTP7pA/python.flask.security.audit.render-template-string.render-template-string\",\"version_id\":\"GxTP7pA\"}}},\"severity\":\"WARNING\",\"fingerprint\":\"1fef9f2ee425958911da7faac417e1f471bdc7ae487cbabd9a91be4ea84a6f83752210264ba5524b467e6c75922346531ffa23e80c7cbb432772b1e9135c7eed_0\",\"lines\":\" return render_template_string(\\\"\\\"\\\"\\n

Intentionally Insecure App

\\n
\\n\\n \\n
\\n

Command Injection

\\n \\n \\n
\\n
\\n\\n \\n
\\n

Path Traversal via File Upload

\\n \\n \\n
\\n

Try uploading a file named: ../../../../etc/passwd

\\n
\\n\\n \\n
\\n

SQL Injection

\\n \\n \\n
\\n
\\n\\n \\n
\\n Enter XSS payload: alert('XSS');\\\">\\n \\n
\\n
\\n\\n \\n
\\n

XML External Entity (XXE) Injection

\\n \\n \\n
\\n
\\n\\n \\n
\\n

Server-Side Request Forgery (SSRF)

\\n \\n \\n
\\n
\\n \\n

SQL Injection 2

\\n
\\n Enter Username: \\n \\n
\\n
\\n
{{ output|safe }}
\\n \\\"\\\"\\\", output=output)\",\"is_ignored\":false,\"validation_state\":\"NO_VALIDATOR\",\"engine_kind\":\"OSS\"}},{\"check_id\":\"python.flask.debug.debug-flask.active-debug-code-flask\",\"path\":\"insecure-app/app.py\",\"start\":{\"line\":168,\"col\":5,\"offset\":6185},\"end\":{\"line\":168,\"col\":51,\"offset\":6231},\"extra\":{\"metavars\":{},\"message\":\"The application is running debug code or has debug mode enabled. This may expose sensitive information, like stack traces and environment variables, to attackers. It may also modify application behavior, potentially enabling attackers to bypass restrictions. To remediate this finding, ensure that the application's debug code and debug mode are disabled or removed from the production environment.\",\"metadata\":{\"likelihood\":\"LOW\",\"impact\":\"MEDIUM\",\"confidence\":\"HIGH\",\"category\":\"security\",\"subcategory\":[\"vuln\"],\"cwe\":[\"CWE-489: Active Debug Code\"],\"display-name\":\"Active Debug Code in Flask\",\"functional-categories\":[\"debug::search::active-debug-code\"],\"references\":[\"https://flask.palletsprojects.com/en/3.0.x/debugging/\"],\"technology\":[\"flask\",\"python\"],\"license\":\"Semgrep Rules License v1.0. For more details, visit semgrep.dev/legal/rules-license\",\"vulnerability_class\":[\"Active Debug Code\"],\"source\":\"https://semgrep.dev/r/python.flask.debug.debug-flask.active-debug-code-flask\",\"shortlink\":\"https://sg.run/lBbpB\",\"semgrep.dev\":{\"rule\":{\"origin\":\"pro_rules\",\"r_id\":116513,\"rule_id\":\"zdUKBnK\",\"rv_id\":947918,\"url\":\"https://semgrep.dev/playground/r/ZRT3q9v/python.flask.debug.debug-flask.active-debug-code-flask\",\"version_id\":\"ZRT3q9v\"}}},\"severity\":\"INFO\",\"fingerprint\":\"c23e60005fcb1bcebdf227cb9726b160a35d2a257d070ed02e48086267e9fc89bc16c372bb201f498a69977f671255ee8a9f79ff39693f60f42f6b326b1cbef7_0\",\"lines\":\" app.run(host='0.0.0.0', port=8080, debug=True)\",\"is_ignored\":false,\"validation_state\":\"NO_VALIDATOR\",\"engine_kind\":\"OSS\"}},{\"check_id\":\"python.flask.security.audit.app-run-param-config.avoid_app_run_with_bad_host\",\"path\":\"insecure-app/app.py\",\"start\":{\"line\":168,\"col\":5,\"offset\":6185},\"end\":{\"line\":168,\"col\":51,\"offset\":6231},\"extra\":{\"metavars\":{},\"message\":\"Running flask app with host 0.0.0.0 could expose the server publicly.\",\"metadata\":{\"cwe\":[\"CWE-668: Exposure of Resource to Wrong Sphere\"],\"owasp\":[\"A01:2021 - Broken Access Control\"],\"category\":\"security\",\"technology\":[\"flask\"],\"references\":[\"https://owasp.org/Top10/A01_2021-Broken_Access_Control\"],\"subcategory\":[\"vuln\"],\"likelihood\":\"HIGH\",\"impact\":\"MEDIUM\",\"confidence\":\"HIGH\",\"license\":\"Semgrep Rules License v1.0. For more details, visit semgrep.dev/legal/rules-license\",\"vulnerability_class\":[\"Other\"],\"source\":\"https://semgrep.dev/r/python.flask.security.audit.app-run-param-config.avoid_app_run_with_bad_host\",\"shortlink\":\"https://sg.run/eLby\",\"semgrep.dev\":{\"rule\":{\"origin\":\"community\",\"r_id\":9532,\"rule_id\":\"L1Uy1n\",\"rv_id\":946204,\"url\":\"https://semgrep.dev/playground/r/7ZTrQkG/python.flask.security.audit.app-run-param-config.avoid_app_run_with_bad_host\",\"version_id\":\"7ZTrQkG\"}}},\"severity\":\"WARNING\",\"fingerprint\":\"031046540eb43011ccbcd463edf2c3003737673f6218b7a22e609d94ff6b0ad99d098ec0307291bb508e6c1ec8d7e08ebdbe7f7670245df69c0a42db45854bd3_0\",\"lines\":\" app.run(host='0.0.0.0', port=8080, debug=True)\",\"is_ignored\":false,\"validation_state\":\"NO_VALIDATOR\",\"engine_kind\":\"OSS\"}},{\"check_id\":\"python.flask.security.audit.debug-enabled.debug-enabled\",\"path\":\"insecure-app/app.py\",\"start\":{\"line\":168,\"col\":5,\"offset\":6185},\"end\":{\"line\":168,\"col\":51,\"offset\":6231},\"extra\":{\"metavars\":{\"$APP\":{\"start\":{\"line\":168,\"col\":5,\"offset\":6185},\"end\":{\"line\":168,\"col\":8,\"offset\":6188},\"abstract_content\":\"app\",\"propagated_value\":{\"svalue_start\":{\"line\":12,\"col\":7,\"offset\":316},\"svalue_end\":{\"line\":12,\"col\":22,\"offset\":331},\"svalue_abstract_content\":\"Flask(__name__)\"}}},\"message\":\"Detected Flask app with debug=True. Do not deploy to production with this flag enabled as it will leak sensitive information. Instead, consider using Flask configuration variables or setting 'debug' using system environment variables.\",\"metadata\":{\"cwe\":[\"CWE-489: Active Debug Code\"],\"owasp\":\"A06:2017 - Security Misconfiguration\",\"references\":[\"https://labs.detectify.com/2015/10/02/how-patreon-got-hacked-publicly-exposed-werkzeug-debugger/\"],\"category\":\"security\",\"technology\":[\"flask\"],\"subcategory\":[\"vuln\"],\"likelihood\":\"HIGH\",\"impact\":\"MEDIUM\",\"confidence\":\"HIGH\",\"license\":\"Semgrep Rules License v1.0. For more details, visit semgrep.dev/legal/rules-license\",\"vulnerability_class\":[\"Active Debug Code\"],\"source\":\"https://semgrep.dev/r/python.flask.security.audit.debug-enabled.debug-enabled\",\"shortlink\":\"https://sg.run/dKrd\",\"semgrep.dev\":{\"rule\":{\"origin\":\"community\",\"r_id\":9534,\"rule_id\":\"gxU1bd\",\"rv_id\":946206,\"url\":\"https://semgrep.dev/playground/r/8KTKjwR/python.flask.security.audit.debug-enabled.debug-enabled\",\"version_id\":\"8KTKjwR\"}}},\"severity\":\"WARNING\",\"fingerprint\":\"688f60f63bb45fb9ddf9a179de37f66efa8644f5976e2115d44c0ee91789446d3bf7d1d4351ea22ab6e616ecb66a2ed26ca94d64746ea41e289bbf71176a4022_0\",\"lines\":\" app.run(host='0.0.0.0', port=8080, debug=True)\",\"is_ignored\":false,\"validation_state\":\"NO_VALIDATOR\",\"engine_kind\":\"OSS\"}},{\"check_id\":\"generic.secrets.security.detected-aws-access-key-id-value.detected-aws-access-key-id-value\",\"path\":\"insecure-app/ransomware.py\",\"start\":{\"line\":34,\"col\":16,\"offset\":1304},\"end\":{\"line\":34,\"col\":36,\"offset\":1324},\"extra\":{\"metavars\":{\"$1\":{\"start\":{\"line\":34,\"col\":16,\"offset\":1304},\"end\":{\"line\":34,\"col\":20,\"offset\":1308},\"abstract_content\":\"AKIA\"}},\"message\":\"AWS Access Key ID Value detected. This is a sensitive credential and should not be hardcoded here. Instead, read this value from an environment variable or keep it in a separate, private file.\",\"metadata\":{\"cwe\":[\"CWE-798: Use of Hard-coded Credentials\"],\"source-rule-url\":\"https://github.com/grab/secret-scanner/blob/master/scanner/signatures/pattern.go\",\"category\":\"security\",\"technology\":[\"secrets\",\"aws\"],\"confidence\":\"LOW\",\"owasp\":[\"A07:2021 - Identification and Authentication Failures\"],\"references\":[\"https://owasp.org/Top10/A07_2021-Identification_and_Authentication_Failures\"],\"cwe2022-top25\":true,\"cwe2021-top25\":true,\"subcategory\":[\"audit\"],\"likelihood\":\"LOW\",\"impact\":\"HIGH\",\"license\":\"Semgrep Rules License v1.0. For more details, visit semgrep.dev/legal/rules-license\",\"vulnerability_class\":[\"Hard-coded Secrets\"],\"source\":\"https://semgrep.dev/r/generic.secrets.security.detected-aws-access-key-id-value.detected-aws-access-key-id-value\",\"shortlink\":\"https://sg.run/GeD1\",\"semgrep.dev\":{\"rule\":{\"origin\":\"community\",\"r_id\":9048,\"rule_id\":\"oqUevO\",\"rv_id\":945484,\"url\":\"https://semgrep.dev/playground/r/rxT6rnL/generic.secrets.security.detected-aws-access-key-id-value.detected-aws-access-key-id-value\",\"version_id\":\"rxT6rnL\"}}},\"severity\":\"ERROR\",\"fingerprint\":\"fdd4bbda379047f46243b39d05251ca1f58d4adf6e262e3e54050a8031935e79a9bed50cdf71107e644efbf18b43f6edcde2cd2905d9bfb43caf67d59f7bcc98_0\",\"lines\":\" aws = \\\"AKIA2JAPX77RGLB664VE\\\"\",\"is_ignored\":false,\"validation_state\":\"NO_VALIDATOR\",\"engine_kind\":\"OSS\"}},{\"check_id\":\"python.lang.security.audit.dynamic-urllib-use-detected.dynamic-urllib-use-detected\",\"path\":\"insecure-app/ransomware.py\",\"start\":{\"line\":143,\"col\":9,\"offset\":6480},\"end\":{\"line\":143,\"col\":51,\"offset\":6522},\"extra\":{\"metavars\":{},\"message\":\"Detected a dynamic value being used with urllib. urllib supports 'file://' schemes, so a dynamic value controlled by a malicious actor may allow them to read arbitrary files. Audit uses of urllib calls to ensure user data cannot control the URLs, or consider using the 'requests' library instead.\",\"metadata\":{\"cwe\":[\"CWE-939: Improper Authorization in Handler for Custom URL Scheme\"],\"owasp\":\"A01:2017 - Injection\",\"source-rule-url\":\"https://github.com/PyCQA/bandit/blob/b1411bfb43795d3ffd268bef17a839dee954c2b1/bandit/blacklists/calls.py#L163\",\"bandit-code\":\"B310\",\"asvs\":{\"control_id\":\"5.2.4 Dynamic Code Execution Features\",\"control_url\":\"https://github.com/OWASP/ASVS/blob/master/4.0/en/0x13-V5-Validation-Sanitization-Encoding.md#v52-sanitization-and-sandboxing-requirements\",\"section\":\"V5: Validation, Sanitization and Encoding Verification Requirements\",\"version\":\"4\"},\"category\":\"security\",\"technology\":[\"python\"],\"references\":[\"https://cwe.mitre.org/data/definitions/939.html\"],\"subcategory\":[\"audit\"],\"likelihood\":\"LOW\",\"impact\":\"LOW\",\"confidence\":\"LOW\",\"license\":\"Semgrep Rules License v1.0. For more details, visit semgrep.dev/legal/rules-license\",\"vulnerability_class\":[\"Improper Authorization\"],\"source\":\"https://semgrep.dev/r/python.lang.security.audit.dynamic-urllib-use-detected.dynamic-urllib-use-detected\",\"shortlink\":\"https://sg.run/dKZZ\",\"semgrep.dev\":{\"rule\":{\"origin\":\"community\",\"r_id\":9634,\"rule_id\":\"8GUj22\",\"rv_id\":946340,\"url\":\"https://semgrep.dev/playground/r/w8TKJbO/python.lang.security.audit.dynamic-urllib-use-detected.dynamic-urllib-use-detected\",\"version_id\":\"w8TKJbO\"}}},\"severity\":\"WARNING\",\"fingerprint\":\"f74fd93d56d0f782bdccefe534a08a0e542f77db7f2e2bd32b3107a3049506b89945891a6570373cd6b214f08cc50198a61a8b4e680dcaadc5cd4dec38437ec0_0\",\"lines\":\" urllib.request.urlretrieve(imageUrl, path)\",\"is_ignored\":false,\"validation_state\":\"NO_VALIDATOR\",\"engine_kind\":\"OSS\"}},{\"check_id\":\"yaml.kubernetes.security.run-as-non-root.run-as-non-root\",\"path\":\"insecure-chart/templates/busybox.yaml\",\"start\":{\"line\":17,\"col\":5,\"offset\":308},\"end\":{\"line\":17,\"col\":9,\"offset\":312},\"extra\":{\"metavars\":{\"$1\":{\"start\":{\"line\":1,\"col\":1,\"offset\":0},\"end\":{\"line\":1,\"col\":5,\"offset\":4},\"abstract_content\":\"spec\"},\"$SPEC\":{\"start\":{\"line\":17,\"col\":5,\"offset\":308},\"end\":{\"line\":17,\"col\":9,\"offset\":312},\"abstract_content\":\"spec\"}},\"message\":\"When running containers in Kubernetes, it's important to ensure that they are properly secured to prevent privilege escalation attacks. One potential vulnerability is when a container is allowed to run applications as the root user, which could allow an attacker to gain access to sensitive resources. To mitigate this risk, it's recommended to add a `securityContext` to the container, with the parameter `runAsNonRoot` set to `true`. This will ensure that the container runs as a non-root user, limiting the damage that could be caused by any potential attacks. By adding a `securityContext` to the container in your Kubernetes pod, you can help to ensure that your containerized applications are more secure and less vulnerable to privilege escalation attacks.\",\"fix\":\"spec:\\n securityContext:\\n runAsNonRoot: true #\",\"metadata\":{\"references\":[\"https://kubernetes.io/blog/2016/08/security-best-practices-kubernetes-deployment/\",\"https://kubernetes.io/docs/concepts/policy/pod-security-policy/\",\"https://cheatsheetseries.owasp.org/cheatsheets/Docker_Security_Cheat_Sheet.html#rule-2-set-a-user\"],\"category\":\"security\",\"cwe\":[\"CWE-250: Execution with Unnecessary Privileges\"],\"owasp\":[\"A05:2021 - Security Misconfiguration\",\"A06:2017 - Security Misconfiguration\"],\"technology\":[\"kubernetes\"],\"subcategory\":[\"audit\"],\"likelihood\":\"LOW\",\"impact\":\"LOW\",\"confidence\":\"LOW\",\"license\":\"Semgrep Rules License v1.0. For more details, visit semgrep.dev/legal/rules-license\",\"vulnerability_class\":[\"Improper Authorization\"],\"source\":\"https://semgrep.dev/r/yaml.kubernetes.security.run-as-non-root.run-as-non-root\",\"shortlink\":\"https://sg.run/dgP5\",\"semgrep.dev\":{\"rule\":{\"origin\":\"community\",\"r_id\":10134,\"rule_id\":\"ZqUqeK\",\"rv_id\":947064,\"url\":\"https://semgrep.dev/playground/r/JdTDP66/yaml.kubernetes.security.run-as-non-root.run-as-non-root\",\"version_id\":\"JdTDP66\"}}},\"severity\":\"INFO\",\"fingerprint\":\"3302f4679b677441ee2e4f843fe636546de78ccbdf7ffa5b66486a65526a675e1ad0c1989e87283307f8e9b2170714659820d02ad476142b371afd41824422ab_0\",\"lines\":\" spec:\",\"is_ignored\":false,\"validation_state\":\"NO_VALIDATOR\",\"engine_kind\":\"OSS\"}},{\"check_id\":\"yaml.kubernetes.security.allow-privilege-escalation-no-securitycontext.allow-privilege-escalation-no-securitycontext\",\"path\":\"insecure-chart/templates/busybox.yaml\",\"start\":{\"line\":19,\"col\":9,\"offset\":340},\"end\":{\"line\":19,\"col\":13,\"offset\":344},\"extra\":{\"metavars\":{\"$NAME\":{\"start\":{\"line\":19,\"col\":9,\"offset\":340},\"end\":{\"line\":19,\"col\":13,\"offset\":344},\"abstract_content\":\"name\"},\"$CONTAINER\":{\"start\":{\"line\":19,\"col\":15,\"offset\":346},\"end\":{\"line\":19,\"col\":22,\"offset\":353},\"abstract_content\":\"busybox\"}},\"message\":\"In Kubernetes, each pod runs in its own isolated environment with its own set of security policies. However, certain container images may contain `setuid` or `setgid` binaries that could allow an attacker to perform privilege escalation and gain access to sensitive resources. To mitigate this risk, it's recommended to add a `securityContext` to the container in the pod, with the parameter `allowPrivilegeEscalation` set to `false`. This will prevent the container from running any privileged processes and limit the impact of any potential attacks. By adding a `securityContext` to your Kubernetes pod, you can help to ensure that your containerized applications are more secure and less vulnerable to privilege escalation attacks.\",\"fix\":\"securityContext:\\n allowPrivilegeEscalation: false\\n name\",\"metadata\":{\"cwe\":[\"CWE-732: Incorrect Permission Assignment for Critical Resource\"],\"owasp\":[\"A05:2021 - Security Misconfiguration\",\"A06:2017 - Security Misconfiguration\"],\"references\":[\"https://kubernetes.io/docs/concepts/policy/pod-security-policy/#privilege-escalation\",\"https://kubernetes.io/docs/tasks/configure-pod-container/security-context/\",\"https://www.kernel.org/doc/Documentation/prctl/no_new_privs.txt\",\"https://cheatsheetseries.owasp.org/cheatsheets/Docker_Security_Cheat_Sheet.html#rule-4-add-no-new-privileges-flag\"],\"category\":\"security\",\"technology\":[\"kubernetes\"],\"cwe2021-top25\":true,\"subcategory\":[\"vuln\"],\"likelihood\":\"MEDIUM\",\"impact\":\"MEDIUM\",\"confidence\":\"MEDIUM\",\"license\":\"Semgrep Rules License v1.0. For more details, visit semgrep.dev/legal/rules-license\",\"vulnerability_class\":[\"Improper Authorization\"],\"source\":\"https://semgrep.dev/r/yaml.kubernetes.security.allow-privilege-escalation-no-securitycontext.allow-privilege-escalation-no-securitycontext\",\"shortlink\":\"https://sg.run/eleR\",\"semgrep.dev\":{\"rule\":{\"origin\":\"community\",\"r_id\":47276,\"rule_id\":\"WAU5J6\",\"rv_id\":947050,\"url\":\"https://semgrep.dev/playground/r/e1T9vzn/yaml.kubernetes.security.allow-privilege-escalation-no-securitycontext.allow-privilege-escalation-no-securitycontext\",\"version_id\":\"e1T9vzn\"}}},\"severity\":\"WARNING\",\"fingerprint\":\"a48a700ff4af7c51c6c89eeda133bc962da19537ab07ae0c31a3e52fa481f4483b37ae55047243392d0f979a5e17ee48f6a31f9e980c15636bb31f6068cc41ac_0\",\"lines\":\" - name: busybox\",\"is_ignored\":false,\"validation_state\":\"NO_VALIDATOR\",\"engine_kind\":\"OSS\"}},{\"check_id\":\"yaml.kubernetes.security.run-as-non-root.run-as-non-root\",\"path\":\"insecure-chart/templates/insecure-app.yaml\",\"start\":{\"line\":16,\"col\":5,\"offset\":360},\"end\":{\"line\":16,\"col\":9,\"offset\":364},\"extra\":{\"metavars\":{\"$1\":{\"start\":{\"line\":1,\"col\":1,\"offset\":0},\"end\":{\"line\":1,\"col\":5,\"offset\":4},\"abstract_content\":\"spec\"},\"$SPEC\":{\"start\":{\"line\":16,\"col\":5,\"offset\":360},\"end\":{\"line\":16,\"col\":9,\"offset\":364},\"abstract_content\":\"spec\"}},\"message\":\"When running containers in Kubernetes, it's important to ensure that they are properly secured to prevent privilege escalation attacks. One potential vulnerability is when a container is allowed to run applications as the root user, which could allow an attacker to gain access to sensitive resources. To mitigate this risk, it's recommended to add a `securityContext` to the container, with the parameter `runAsNonRoot` set to `true`. This will ensure that the container runs as a non-root user, limiting the damage that could be caused by any potential attacks. By adding a `securityContext` to the container in your Kubernetes pod, you can help to ensure that your containerized applications are more secure and less vulnerable to privilege escalation attacks.\",\"fix\":\"spec:\\n securityContext:\\n runAsNonRoot: true #\",\"metadata\":{\"references\":[\"https://kubernetes.io/blog/2016/08/security-best-practices-kubernetes-deployment/\",\"https://kubernetes.io/docs/concepts/policy/pod-security-policy/\",\"https://cheatsheetseries.owasp.org/cheatsheets/Docker_Security_Cheat_Sheet.html#rule-2-set-a-user\"],\"category\":\"security\",\"cwe\":[\"CWE-250: Execution with Unnecessary Privileges\"],\"owasp\":[\"A05:2021 - Security Misconfiguration\",\"A06:2017 - Security Misconfiguration\"],\"technology\":[\"kubernetes\"],\"subcategory\":[\"audit\"],\"likelihood\":\"LOW\",\"impact\":\"LOW\",\"confidence\":\"LOW\",\"license\":\"Semgrep Rules License v1.0. For more details, visit semgrep.dev/legal/rules-license\",\"vulnerability_class\":[\"Improper Authorization\"],\"source\":\"https://semgrep.dev/r/yaml.kubernetes.security.run-as-non-root.run-as-non-root\",\"shortlink\":\"https://sg.run/dgP5\",\"semgrep.dev\":{\"rule\":{\"origin\":\"community\",\"r_id\":10134,\"rule_id\":\"ZqUqeK\",\"rv_id\":947064,\"url\":\"https://semgrep.dev/playground/r/JdTDP66/yaml.kubernetes.security.run-as-non-root.run-as-non-root\",\"version_id\":\"JdTDP66\"}}},\"severity\":\"INFO\",\"fingerprint\":\"aecd9bc14da55ad92c0e9f7a736c60d78bfe9d474551beb8606b92da97641b6af609317b6d0a64e78230567359a2a9889b5bd3ae0b3615997a0dd2adcf7ce4b0_0\",\"lines\":\" spec:\",\"is_ignored\":false,\"validation_state\":\"NO_VALIDATOR\",\"engine_kind\":\"OSS\"}},{\"check_id\":\"yaml.kubernetes.security.privileged-container.privileged-container\",\"path\":\"insecure-chart/templates/insecure-app.yaml\",\"start\":{\"line\":18,\"col\":9,\"offset\":392},\"end\":{\"line\":29,\"col\":42,\"offset\":873},\"extra\":{\"metavars\":{},\"message\":\"Container or pod is running in privileged mode. This grants the container the equivalent of root capabilities on the host machine. This can lead to container escapes, privilege escalation, and other security concerns. Remove the 'privileged' key to disable this capability.\",\"metadata\":{\"cwe\":[\"CWE-250: Execution with Unnecessary Privileges\"],\"references\":[\"https://kubernetes.io/docs/concepts/policy/pod-security-policy/#privileged\",\"https://kubernetes.io/docs/tasks/configure-pod-container/security-context/\",\"https://cheatsheetseries.owasp.org/cheatsheets/Docker_Security_Cheat_Sheet.html\"],\"category\":\"security\",\"technology\":[\"kubernetes\"],\"subcategory\":[\"vuln\"],\"likelihood\":\"MEDIUM\",\"impact\":\"MEDIUM\",\"confidence\":\"MEDIUM\",\"license\":\"Semgrep Rules License v1.0. For more details, visit semgrep.dev/legal/rules-license\",\"vulnerability_class\":[\"Improper Authorization\"],\"source\":\"https://semgrep.dev/r/yaml.kubernetes.security.privileged-container.privileged-container\",\"shortlink\":\"https://sg.run/Ygr5\",\"semgrep.dev\":{\"rule\":{\"origin\":\"community\",\"r_id\":10058,\"rule_id\":\"oqUz2p\",\"rv_id\":947059,\"url\":\"https://semgrep.dev/playground/r/gETeWJA/yaml.kubernetes.security.privileged-container.privileged-container\",\"version_id\":\"gETeWJA\"}}},\"severity\":\"WARNING\",\"fingerprint\":\"8d8d14c31ce0b4adf0e8554f956c7a41ec94f13ad055f4ece2cb0b87d686c8b738020157487eef0b9e5a722092576c68524c0d9200bff9f851caba9f6fd196c4_0\",\"lines\":\" - name: {{ .Values.insecureApp.appName }}\\n image: \\\"{{ .Values.insecureApp.image.repository }}:{{ .Values.insecureApp.image.tag }}\\\"\\n env:\\n - name: AWS_ACCESS_KEY_ID\\n value: AKIA2JAPX77RGLB664VE\\n - name: AWS_SECRET_ACCESS_KEY\\n value: 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\\n securityContext:\\n privileged: true\\n volumeMounts: \\n - name: docker-socket\\n mountPath: /var/run/docker.sock\",\"is_ignored\":false,\"validation_state\":\"NO_VALIDATOR\",\"engine_kind\":\"OSS\"}},{\"check_id\":\"generic.secrets.security.detected-aws-access-key-id-value.detected-aws-access-key-id-value\",\"path\":\"insecure-chart/templates/insecure-app.yaml\",\"start\":{\"line\":22,\"col\":18,\"offset\":592},\"end\":{\"line\":22,\"col\":38,\"offset\":612},\"extra\":{\"metavars\":{\"$1\":{\"start\":{\"line\":22,\"col\":18,\"offset\":592},\"end\":{\"line\":22,\"col\":22,\"offset\":596},\"abstract_content\":\"AKIA\"}},\"message\":\"AWS Access Key ID Value detected. This is a sensitive credential and should not be hardcoded here. Instead, read this value from an environment variable or keep it in a separate, private file.\",\"metadata\":{\"cwe\":[\"CWE-798: Use of Hard-coded Credentials\"],\"source-rule-url\":\"https://github.com/grab/secret-scanner/blob/master/scanner/signatures/pattern.go\",\"category\":\"security\",\"technology\":[\"secrets\",\"aws\"],\"confidence\":\"LOW\",\"owasp\":[\"A07:2021 - Identification and Authentication Failures\"],\"references\":[\"https://owasp.org/Top10/A07_2021-Identification_and_Authentication_Failures\"],\"cwe2022-top25\":true,\"cwe2021-top25\":true,\"subcategory\":[\"audit\"],\"likelihood\":\"LOW\",\"impact\":\"HIGH\",\"license\":\"Semgrep Rules License v1.0. For more details, visit semgrep.dev/legal/rules-license\",\"vulnerability_class\":[\"Hard-coded Secrets\"],\"source\":\"https://semgrep.dev/r/generic.secrets.security.detected-aws-access-key-id-value.detected-aws-access-key-id-value\",\"shortlink\":\"https://sg.run/GeD1\",\"semgrep.dev\":{\"rule\":{\"origin\":\"community\",\"r_id\":9048,\"rule_id\":\"oqUevO\",\"rv_id\":945484,\"url\":\"https://semgrep.dev/playground/r/rxT6rnL/generic.secrets.security.detected-aws-access-key-id-value.detected-aws-access-key-id-value\",\"version_id\":\"rxT6rnL\"}}},\"severity\":\"ERROR\",\"fingerprint\":\"ba1eb8f472ad179589a1a9121d0766ca94d347074ca129508802d4537dae2c423d53533f10e88538157501b54215abf7a7d0b8b024b182219f664bbd8111d6a4_0\",\"lines\":\" value: AKIA2JAPX77RGLB664VE\",\"is_ignored\":false,\"validation_state\":\"NO_VALIDATOR\",\"engine_kind\":\"OSS\"}},{\"check_id\":\"yaml.kubernetes.security.allow-privilege-escalation.allow-privilege-escalation\",\"path\":\"insecure-chart/templates/insecure-app.yaml\",\"start\":{\"line\":25,\"col\":9,\"offset\":717},\"end\":{\"line\":25,\"col\":24,\"offset\":732},\"extra\":{\"metavars\":{\"$1\":{\"start\":{\"line\":1,\"col\":1,\"offset\":0},\"end\":{\"line\":1,\"col\":16,\"offset\":15},\"abstract_content\":\"securityContext\"},\"$CONTAINER\":{\"start\":{\"line\":18,\"col\":15,\"offset\":398},\"end\":{\"line\":18,\"col\":47,\"offset\":430},\"abstract_content\":\"(())\"},\"$SC\":{\"start\":{\"line\":25,\"col\":9,\"offset\":717},\"end\":{\"line\":25,\"col\":24,\"offset\":732},\"abstract_content\":\"securityContext\"}},\"message\":\"In Kubernetes, each pod runs in its own isolated environment with its own set of security policies. However, certain container images may contain `setuid` or `setgid` binaries that could allow an attacker to perform privilege escalation and gain access to sensitive resources. To mitigate this risk, it's recommended to add a `securityContext` to the container in the pod, with the parameter `allowPrivilegeEscalation` set to `false`. This will prevent the container from running any privileged processes and limit the impact of any potential attacks. By adding the `allowPrivilegeEscalation` parameter to your the `securityContext`, you can help to ensure that your containerized applications are more secure and less vulnerable to privilege escalation attacks.\",\"fix\":\"securityContext:\\n allowPrivilegeEscalation: false #\",\"metadata\":{\"cwe\":[\"CWE-732: Incorrect Permission Assignment for Critical Resource\"],\"owasp\":[\"A05:2021 - Security Misconfiguration\",\"A06:2017 - Security Misconfiguration\"],\"references\":[\"https://kubernetes.io/docs/concepts/policy/pod-security-policy/#privilege-escalation\",\"https://kubernetes.io/docs/tasks/configure-pod-container/security-context/\",\"https://www.kernel.org/doc/Documentation/prctl/no_new_privs.txt\",\"https://cheatsheetseries.owasp.org/cheatsheets/Docker_Security_Cheat_Sheet.html#rule-4-add-no-new-privileges-flag\"],\"category\":\"security\",\"technology\":[\"kubernetes\"],\"cwe2021-top25\":true,\"subcategory\":[\"vuln\"],\"likelihood\":\"MEDIUM\",\"impact\":\"MEDIUM\",\"confidence\":\"MEDIUM\",\"license\":\"Semgrep Rules License v1.0. For more details, visit semgrep.dev/legal/rules-license\",\"vulnerability_class\":[\"Improper Authorization\"],\"source\":\"https://semgrep.dev/r/yaml.kubernetes.security.allow-privilege-escalation.allow-privilege-escalation\",\"shortlink\":\"https://sg.run/ljp6\",\"semgrep.dev\":{\"rule\":{\"origin\":\"community\",\"r_id\":10057,\"rule_id\":\"6JUqEO\",\"rv_id\":947052,\"url\":\"https://semgrep.dev/playground/r/d6TPzeB/yaml.kubernetes.security.allow-privilege-escalation.allow-privilege-escalation\",\"version_id\":\"d6TPzeB\"}}},\"severity\":\"WARNING\",\"fingerprint\":\"776c179c073a251128c9a229b958fb3881849cef53c32d7c8b5634da2885d6373e79e7a39068a1679423ccd0b409c0620683f9a0c95d65177fb897fb48ffd794_0\",\"lines\":\" securityContext:\",\"is_ignored\":false,\"validation_state\":\"NO_VALIDATOR\",\"engine_kind\":\"OSS\"}},{\"check_id\":\"yaml.kubernetes.security.exposing-docker-socket-hostpath.exposing-docker-socket-hostpath\",\"path\":\"insecure-chart/templates/insecure-app.yaml\",\"start\":{\"line\":32,\"col\":9,\"offset\":950},\"end\":{\"line\":33,\"col\":37,\"offset\":996},\"extra\":{\"metavars\":{},\"message\":\"Exposing host's Docker socket to containers via a volume. The owner of this socket is root. Giving someone access to it is equivalent to giving unrestricted root access to your host. Remove 'docker.sock' from hostpath to prevent this.\",\"metadata\":{\"cwe\":[\"CWE-250: Execution with Unnecessary Privileges\"],\"references\":[\"https://kubernetes.io/docs/concepts/storage/volumes/#hostpath\",\"https://kubernetes.io/docs/concepts/policy/pod-security-policy/#volumes-and-file-systems\",\"https://kubernetes.io/docs/tasks/configure-pod-container/security-context/\",\"https://cheatsheetseries.owasp.org/cheatsheets/Docker_Security_Cheat_Sheet.html#rule-1-do-not-expose-the-docker-daemon-socket-even-to-the-containers\"],\"category\":\"security\",\"technology\":[\"kubernetes\"],\"subcategory\":[\"vuln\"],\"likelihood\":\"LOW\",\"impact\":\"HIGH\",\"confidence\":\"MEDIUM\",\"license\":\"Semgrep Rules License v1.0. For more details, visit semgrep.dev/legal/rules-license\",\"vulnerability_class\":[\"Improper Authorization\"],\"source\":\"https://semgrep.dev/r/yaml.kubernetes.security.exposing-docker-socket-hostpath.exposing-docker-socket-hostpath\",\"shortlink\":\"https://sg.run/v0pR\",\"semgrep.dev\":{\"rule\":{\"origin\":\"community\",\"r_id\":10133,\"rule_id\":\"d8Uz6v\",\"rv_id\":947054,\"url\":\"https://semgrep.dev/playground/r/nWTpYZe/yaml.kubernetes.security.exposing-docker-socket-hostpath.exposing-docker-socket-hostpath\",\"version_id\":\"nWTpYZe\"}}},\"severity\":\"WARNING\",\"fingerprint\":\"7a6331004e7b6359a35200b986c57fc54a82ffc3d1eb71848fd4606545dfb3d195d9a1edd879c8d74c12364291a00adef95be1779caead61655b0590e63d01a9_0\",\"lines\":\" hostPath:\\n path: /var/run/docker.sock\",\"is_ignored\":false,\"validation_state\":\"NO_VALIDATOR\",\"engine_kind\":\"OSS\"}},{\"check_id\":\"yaml.kubernetes.security.run-as-non-root.run-as-non-root\",\"path\":\"insecure-chart/templates/workload-security-evaluator.yaml\",\"start\":{\"line\":16,\"col\":5,\"offset\":430},\"end\":{\"line\":16,\"col\":9,\"offset\":434},\"extra\":{\"metavars\":{\"$1\":{\"start\":{\"line\":1,\"col\":1,\"offset\":0},\"end\":{\"line\":1,\"col\":5,\"offset\":4},\"abstract_content\":\"spec\"},\"$SPEC\":{\"start\":{\"line\":16,\"col\":5,\"offset\":430},\"end\":{\"line\":16,\"col\":9,\"offset\":434},\"abstract_content\":\"spec\"}},\"message\":\"When running containers in Kubernetes, it's important to ensure that they are properly secured to prevent privilege escalation attacks. One potential vulnerability is when a container is allowed to run applications as the root user, which could allow an attacker to gain access to sensitive resources. To mitigate this risk, it's recommended to add a `securityContext` to the container, with the parameter `runAsNonRoot` set to `true`. This will ensure that the container runs as a non-root user, limiting the damage that could be caused by any potential attacks. By adding a `securityContext` to the container in your Kubernetes pod, you can help to ensure that your containerized applications are more secure and less vulnerable to privilege escalation attacks.\",\"fix\":\"spec:\\n securityContext:\\n runAsNonRoot: true #\",\"metadata\":{\"references\":[\"https://kubernetes.io/blog/2016/08/security-best-practices-kubernetes-deployment/\",\"https://kubernetes.io/docs/concepts/policy/pod-security-policy/\",\"https://cheatsheetseries.owasp.org/cheatsheets/Docker_Security_Cheat_Sheet.html#rule-2-set-a-user\"],\"category\":\"security\",\"cwe\":[\"CWE-250: Execution with Unnecessary Privileges\"],\"owasp\":[\"A05:2021 - Security Misconfiguration\",\"A06:2017 - Security Misconfiguration\"],\"technology\":[\"kubernetes\"],\"subcategory\":[\"audit\"],\"likelihood\":\"LOW\",\"impact\":\"LOW\",\"confidence\":\"LOW\",\"license\":\"Semgrep Rules License v1.0. For more details, visit semgrep.dev/legal/rules-license\",\"vulnerability_class\":[\"Improper Authorization\"],\"source\":\"https://semgrep.dev/r/yaml.kubernetes.security.run-as-non-root.run-as-non-root\",\"shortlink\":\"https://sg.run/dgP5\",\"semgrep.dev\":{\"rule\":{\"origin\":\"community\",\"r_id\":10134,\"rule_id\":\"ZqUqeK\",\"rv_id\":947064,\"url\":\"https://semgrep.dev/playground/r/JdTDP66/yaml.kubernetes.security.run-as-non-root.run-as-non-root\",\"version_id\":\"JdTDP66\"}}},\"severity\":\"INFO\",\"fingerprint\":\"3a55f533ac5a5a36509690fa17d989dd74b859c9205068f60ce9ebc206764744c02e0240842db0f7d7fc4dc7b2cab157033ce576fdc1904bd58eb04f84b184ec_0\",\"lines\":\" spec:\",\"is_ignored\":false,\"validation_state\":\"NO_VALIDATOR\",\"engine_kind\":\"OSS\"}},{\"check_id\":\"yaml.kubernetes.security.privileged-container.privileged-container\",\"path\":\"insecure-chart/templates/workload-security-evaluator.yaml\",\"start\":{\"line\":18,\"col\":9,\"offset\":462},\"end\":{\"line\":29,\"col\":30,\"offset\":966},\"extra\":{\"metavars\":{},\"message\":\"Container or pod is running in privileged mode. This grants the container the equivalent of root capabilities on the host machine. This can lead to container escapes, privilege escalation, and other security concerns. Remove the 'privileged' key to disable this capability.\",\"metadata\":{\"cwe\":[\"CWE-250: Execution with Unnecessary Privileges\"],\"references\":[\"https://kubernetes.io/docs/concepts/policy/pod-security-policy/#privileged\",\"https://kubernetes.io/docs/tasks/configure-pod-container/security-context/\",\"https://cheatsheetseries.owasp.org/cheatsheets/Docker_Security_Cheat_Sheet.html\"],\"category\":\"security\",\"technology\":[\"kubernetes\"],\"subcategory\":[\"vuln\"],\"likelihood\":\"MEDIUM\",\"impact\":\"MEDIUM\",\"confidence\":\"MEDIUM\",\"license\":\"Semgrep Rules License v1.0. For more details, visit semgrep.dev/legal/rules-license\",\"vulnerability_class\":[\"Improper Authorization\"],\"source\":\"https://semgrep.dev/r/yaml.kubernetes.security.privileged-container.privileged-container\",\"shortlink\":\"https://sg.run/Ygr5\",\"semgrep.dev\":{\"rule\":{\"origin\":\"community\",\"r_id\":10058,\"rule_id\":\"oqUz2p\",\"rv_id\":947059,\"url\":\"https://semgrep.dev/playground/r/gETeWJA/yaml.kubernetes.security.privileged-container.privileged-container\",\"version_id\":\"gETeWJA\"}}},\"severity\":\"WARNING\",\"fingerprint\":\"ffd554b207fb80ce294cc034390d4474858d4264f036ada1a1c11e8b6925b9d1d3231425104899b500b80be005ad1001395576ee17aff2683b9cf73520697663_0\",\"lines\":\" - name: {{ .Values.workloadSecurityEvaluator.appName }}\\n image: \\\"{{ .Values.workloadSecurityEvaluator.image.repository }}:{{ .Values.workloadSecurityEvaluator.image.tag }}\\\"\\n env:\\n - name: AWS_ACCESS_KEY_ID\\n value: AKIA2JAPX77RGLB664VE\\n - name: AWS_SECRET_ACCESS_KEY\\n value: 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\\n securityContext:\\n privileged: true\\n volumeMounts:\\n - mountPath: /var/run/docker.sock\\n name: docker-socket\",\"is_ignored\":false,\"validation_state\":\"NO_VALIDATOR\",\"engine_kind\":\"OSS\"}},{\"check_id\":\"generic.secrets.security.detected-aws-access-key-id-value.detected-aws-access-key-id-value\",\"path\":\"insecure-chart/templates/workload-security-evaluator.yaml\",\"start\":{\"line\":22,\"col\":18,\"offset\":704},\"end\":{\"line\":22,\"col\":38,\"offset\":724},\"extra\":{\"metavars\":{\"$1\":{\"start\":{\"line\":22,\"col\":18,\"offset\":704},\"end\":{\"line\":22,\"col\":22,\"offset\":708},\"abstract_content\":\"AKIA\"}},\"message\":\"AWS Access Key ID Value detected. This is a sensitive credential and should not be hardcoded here. Instead, read this value from an environment variable or keep it in a separate, private file.\",\"metadata\":{\"cwe\":[\"CWE-798: Use of Hard-coded Credentials\"],\"source-rule-url\":\"https://github.com/grab/secret-scanner/blob/master/scanner/signatures/pattern.go\",\"category\":\"security\",\"technology\":[\"secrets\",\"aws\"],\"confidence\":\"LOW\",\"owasp\":[\"A07:2021 - Identification and Authentication Failures\"],\"references\":[\"https://owasp.org/Top10/A07_2021-Identification_and_Authentication_Failures\"],\"cwe2022-top25\":true,\"cwe2021-top25\":true,\"subcategory\":[\"audit\"],\"likelihood\":\"LOW\",\"impact\":\"HIGH\",\"license\":\"Semgrep Rules License v1.0. For more details, visit semgrep.dev/legal/rules-license\",\"vulnerability_class\":[\"Hard-coded Secrets\"],\"source\":\"https://semgrep.dev/r/generic.secrets.security.detected-aws-access-key-id-value.detected-aws-access-key-id-value\",\"shortlink\":\"https://sg.run/GeD1\",\"semgrep.dev\":{\"rule\":{\"origin\":\"community\",\"r_id\":9048,\"rule_id\":\"oqUevO\",\"rv_id\":945484,\"url\":\"https://semgrep.dev/playground/r/rxT6rnL/generic.secrets.security.detected-aws-access-key-id-value.detected-aws-access-key-id-value\",\"version_id\":\"rxT6rnL\"}}},\"severity\":\"ERROR\",\"fingerprint\":\"d5ec8967dc8f57fcd421997dda6a0abac3a0cc762e6534246a83ffc2a37741ad06e18ee176aa6dbbc85c400080f78f59914c17b2bb32704ae8b360092860feca_0\",\"lines\":\" value: AKIA2JAPX77RGLB664VE\",\"is_ignored\":false,\"validation_state\":\"NO_VALIDATOR\",\"engine_kind\":\"OSS\"}},{\"check_id\":\"yaml.kubernetes.security.allow-privilege-escalation.allow-privilege-escalation\",\"path\":\"insecure-chart/templates/workload-security-evaluator.yaml\",\"start\":{\"line\":25,\"col\":9,\"offset\":829},\"end\":{\"line\":25,\"col\":24,\"offset\":844},\"extra\":{\"metavars\":{\"$1\":{\"start\":{\"line\":1,\"col\":1,\"offset\":0},\"end\":{\"line\":1,\"col\":16,\"offset\":15},\"abstract_content\":\"securityContext\"},\"$CONTAINER\":{\"start\":{\"line\":18,\"col\":15,\"offset\":468},\"end\":{\"line\":18,\"col\":61,\"offset\":514},\"abstract_content\":\"(())\"},\"$SC\":{\"start\":{\"line\":25,\"col\":9,\"offset\":829},\"end\":{\"line\":25,\"col\":24,\"offset\":844},\"abstract_content\":\"securityContext\"}},\"message\":\"In Kubernetes, each pod runs in its own isolated environment with its own set of security policies. However, certain container images may contain `setuid` or `setgid` binaries that could allow an attacker to perform privilege escalation and gain access to sensitive resources. To mitigate this risk, it's recommended to add a `securityContext` to the container in the pod, with the parameter `allowPrivilegeEscalation` set to `false`. This will prevent the container from running any privileged processes and limit the impact of any potential attacks. By adding the `allowPrivilegeEscalation` parameter to your the `securityContext`, you can help to ensure that your containerized applications are more secure and less vulnerable to privilege escalation attacks.\",\"fix\":\"securityContext:\\n allowPrivilegeEscalation: false #\",\"metadata\":{\"cwe\":[\"CWE-732: Incorrect Permission Assignment for Critical Resource\"],\"owasp\":[\"A05:2021 - Security Misconfiguration\",\"A06:2017 - Security Misconfiguration\"],\"references\":[\"https://kubernetes.io/docs/concepts/policy/pod-security-policy/#privilege-escalation\",\"https://kubernetes.io/docs/tasks/configure-pod-container/security-context/\",\"https://www.kernel.org/doc/Documentation/prctl/no_new_privs.txt\",\"https://cheatsheetseries.owasp.org/cheatsheets/Docker_Security_Cheat_Sheet.html#rule-4-add-no-new-privileges-flag\"],\"category\":\"security\",\"technology\":[\"kubernetes\"],\"cwe2021-top25\":true,\"subcategory\":[\"vuln\"],\"likelihood\":\"MEDIUM\",\"impact\":\"MEDIUM\",\"confidence\":\"MEDIUM\",\"license\":\"Semgrep Rules License v1.0. For more details, visit semgrep.dev/legal/rules-license\",\"vulnerability_class\":[\"Improper Authorization\"],\"source\":\"https://semgrep.dev/r/yaml.kubernetes.security.allow-privilege-escalation.allow-privilege-escalation\",\"shortlink\":\"https://sg.run/ljp6\",\"semgrep.dev\":{\"rule\":{\"origin\":\"community\",\"r_id\":10057,\"rule_id\":\"6JUqEO\",\"rv_id\":947052,\"url\":\"https://semgrep.dev/playground/r/d6TPzeB/yaml.kubernetes.security.allow-privilege-escalation.allow-privilege-escalation\",\"version_id\":\"d6TPzeB\"}}},\"severity\":\"WARNING\",\"fingerprint\":\"7021c010b8d0b11136f68b6c85d57b318861ada3d7a906b6942146314eb665dcc6e36826b1deb04c3c890bc829879387ca5ebfcd9d6960554f48900e55355b8f_0\",\"lines\":\" securityContext:\",\"is_ignored\":false,\"validation_state\":\"NO_VALIDATOR\",\"engine_kind\":\"OSS\"}},{\"check_id\":\"yaml.kubernetes.security.exposing-docker-socket-hostpath.exposing-docker-socket-hostpath\",\"path\":\"insecure-chart/templates/workload-security-evaluator.yaml\",\"start\":{\"line\":31,\"col\":9,\"offset\":990},\"end\":{\"line\":32,\"col\":37,\"offset\":1036},\"extra\":{\"metavars\":{},\"message\":\"Exposing host's Docker socket to containers via a volume. The owner of this socket is root. Giving someone access to it is equivalent to giving unrestricted root access to your host. Remove 'docker.sock' from hostpath to prevent this.\",\"metadata\":{\"cwe\":[\"CWE-250: Execution with Unnecessary Privileges\"],\"references\":[\"https://kubernetes.io/docs/concepts/storage/volumes/#hostpath\",\"https://kubernetes.io/docs/concepts/policy/pod-security-policy/#volumes-and-file-systems\",\"https://kubernetes.io/docs/tasks/configure-pod-container/security-context/\",\"https://cheatsheetseries.owasp.org/cheatsheets/Docker_Security_Cheat_Sheet.html#rule-1-do-not-expose-the-docker-daemon-socket-even-to-the-containers\"],\"category\":\"security\",\"technology\":[\"kubernetes\"],\"subcategory\":[\"vuln\"],\"likelihood\":\"LOW\",\"impact\":\"HIGH\",\"confidence\":\"MEDIUM\",\"license\":\"Semgrep Rules License v1.0. For more details, visit semgrep.dev/legal/rules-license\",\"vulnerability_class\":[\"Improper Authorization\"],\"source\":\"https://semgrep.dev/r/yaml.kubernetes.security.exposing-docker-socket-hostpath.exposing-docker-socket-hostpath\",\"shortlink\":\"https://sg.run/v0pR\",\"semgrep.dev\":{\"rule\":{\"origin\":\"community\",\"r_id\":10133,\"rule_id\":\"d8Uz6v\",\"rv_id\":947054,\"url\":\"https://semgrep.dev/playground/r/nWTpYZe/yaml.kubernetes.security.exposing-docker-socket-hostpath.exposing-docker-socket-hostpath\",\"version_id\":\"nWTpYZe\"}}},\"severity\":\"WARNING\",\"fingerprint\":\"b0fa2105cf388aaf61f7d9b9f73a03a2342c2992b3a938f4e64785c6ec896ee80151e782d77db28ca4efc171718fee4f95c80bb416c5f8c965787ea2faff9d45_0\",\"lines\":\" - hostPath:\\n path: /var/run/docker.sock\",\"is_ignored\":false,\"validation_state\":\"NO_VALIDATOR\",\"engine_kind\":\"OSS\"}},{\"check_id\":\"dockerfile.security.missing-user-entrypoint.missing-user-entrypoint\",\"path\":\"insecure-java/Dockerfile\",\"start\":{\"line\":7,\"col\":1,\"offset\":130},\"end\":{\"line\":7,\"col\":38,\"offset\":167},\"extra\":{\"metavars\":{\"$...VARS\":{\"start\":{\"line\":7,\"col\":12,\"offset\":141},\"end\":{\"line\":7,\"col\":38,\"offset\":167},\"abstract_content\":\"[\\\"java\\\"\\\"-jar\\\"\\\"/app.jar\\\"]\"}},\"message\":\"By not specifying a USER, a program in the container may run as 'root'. This is a security hazard. If an attacker can control a process running as root, they may have control over the container. Ensure that the last USER in a Dockerfile is a USER other than 'root'.\",\"fix\":\"USER non-root\\nENTRYPOINT [\\\"java\\\",\\\"-jar\\\",\\\"/app.jar\\\"]\",\"metadata\":{\"cwe\":[\"CWE-269: Improper Privilege Management\"],\"category\":\"security\",\"technology\":[\"dockerfile\"],\"confidence\":\"MEDIUM\",\"owasp\":[\"A04:2021 - Insecure Design\"],\"references\":[\"https://owasp.org/Top10/A04_2021-Insecure_Design\"],\"subcategory\":[\"audit\"],\"likelihood\":\"LOW\",\"impact\":\"MEDIUM\",\"license\":\"Semgrep Rules License v1.0. For more details, visit semgrep.dev/legal/rules-license\",\"vulnerability_class\":[\"Improper Authorization\"],\"source\":\"https://semgrep.dev/r/dockerfile.security.missing-user-entrypoint.missing-user-entrypoint\",\"shortlink\":\"https://sg.run/k281\",\"semgrep.dev\":{\"rule\":{\"origin\":\"community\",\"r_id\":47272,\"rule_id\":\"ReUW9E\",\"rv_id\":945268,\"url\":\"https://semgrep.dev/playground/r/K3TJbJg/dockerfile.security.missing-user-entrypoint.missing-user-entrypoint\",\"version_id\":\"K3TJbJg\"}}},\"severity\":\"ERROR\",\"fingerprint\":\"8a9ae537c70377699ac7b95add8f39d7bc1192dbb0a0a2e524f7a4e126adfa3e0bcc6c074eeb891021d031d42e016675c69dd491f4bc4116bef9ab0dba840233_0\",\"lines\":\"ENTRYPOINT [\\\"java\\\",\\\"-jar\\\",\\\"/app.jar\\\"]\",\"is_ignored\":false,\"validation_state\":\"NO_VALIDATOR\",\"engine_kind\":\"OSS\"}},{\"check_id\":\"java.spring.security.injection.tainted-sql-string.tainted-sql-string\",\"path\":\"insecure-java/src/main/java/com/example/catapp/controllers/CatPictureController.java\",\"start\":{\"line\":25,\"col\":24,\"offset\":763},\"end\":{\"line\":25,\"col\":80,\"offset\":819},\"extra\":{\"metavars\":{\"$1\":{\"start\":{\"line\":1,\"col\":1,\"offset\":0},\"end\":{\"line\":1,\"col\":7,\"offset\":6},\"abstract_content\":\"SELECT\"},\"$METHODNAME\":{\"start\":{\"line\":23,\"col\":19,\"offset\":652},\"end\":{\"line\":23,\"col\":25,\"offset\":658},\"abstract_content\":\"search\"},\"$REQ\":{\"start\":{\"line\":23,\"col\":27,\"offset\":660},\"end\":{\"line\":23,\"col\":39,\"offset\":672},\"abstract_content\":\"RequestParam\"},\"$TYPE\":{\"start\":{\"line\":23,\"col\":40,\"offset\":673},\"end\":{\"line\":23,\"col\":46,\"offset\":679},\"abstract_content\":\"String\"},\"$SOURCE\":{\"start\":{\"line\":23,\"col\":47,\"offset\":680},\"end\":{\"line\":23,\"col\":51,\"offset\":684},\"abstract_content\":\"name\"},\"$SQLSTR\":{\"start\":{\"line\":25,\"col\":25,\"offset\":764},\"end\":{\"line\":25,\"col\":66,\"offset\":805},\"abstract_content\":\"SELECT * FROM cat_pictures WHERE name = '\"}},\"message\":\"User data flows into this manually-constructed SQL string. User data can be safely inserted into SQL strings using prepared statements or an object-relational mapper (ORM). Manually-constructed SQL strings is a possible indicator of SQL injection, which could let an attacker steal or manipulate data from the database. Instead, use prepared statements (`connection.PreparedStatement`) or a safe library.\",\"metadata\":{\"cwe\":[\"CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')\"],\"owasp\":[\"A01:2017 - Injection\",\"A03:2021 - Injection\"],\"references\":[\"https://docs.oracle.com/javase/7/docs/api/java/sql/PreparedStatement.html\"],\"category\":\"security\",\"technology\":[\"spring\"],\"cwe2022-top25\":true,\"cwe2021-top25\":true,\"subcategory\":[\"vuln\"],\"likelihood\":\"HIGH\",\"impact\":\"MEDIUM\",\"confidence\":\"MEDIUM\",\"interfile\":true,\"license\":\"Semgrep Rules License v1.0. For more details, visit semgrep.dev/legal/rules-license\",\"vulnerability_class\":[\"SQL Injection\"],\"source\":\"https://semgrep.dev/r/java.spring.security.injection.tainted-sql-string.tainted-sql-string\",\"shortlink\":\"https://sg.run/9rzz\",\"semgrep.dev\":{\"rule\":{\"origin\":\"community\",\"r_id\":14767,\"rule_id\":\"10UdRR\",\"rv_id\":945745,\"url\":\"https://semgrep.dev/playground/r/8KTKj0G/java.spring.security.injection.tainted-sql-string.tainted-sql-string\",\"version_id\":\"8KTKj0G\"}}},\"severity\":\"ERROR\",\"fingerprint\":\"972b22c89a9412da436c82ad486252920fb59fae559c701cb90b25028e1799517d5c6797f5fd5a85ab13c3f05366cc2a858bdb566d53fc311eb720b717fae81f_0\",\"lines\":\" String query = \\\"SELECT * FROM cat_pictures WHERE name = '\\\" + name + \\\"'\\\";\",\"is_ignored\":false,\"validation_state\":\"NO_VALIDATOR\",\"dataflow_trace\":{\"taint_source\":[\"CliLoc\",[{\"path\":\"insecure-java/src/main/java/com/example/catapp/controllers/CatPictureController.java\",\"start\":{\"line\":23,\"col\":47,\"offset\":680},\"end\":{\"line\":23,\"col\":51,\"offset\":684}},\"name\"]],\"intermediate_vars\":[{\"location\":{\"path\":\"insecure-java/src/main/java/com/example/catapp/controllers/CatPictureController.java\",\"start\":{\"line\":23,\"col\":47,\"offset\":680},\"end\":{\"line\":23,\"col\":51,\"offset\":684}},\"content\":\"name\"}],\"taint_sink\":[\"CliLoc\",[{\"path\":\"insecure-java/src/main/java/com/example/catapp/controllers/CatPictureController.java\",\"start\":{\"line\":25,\"col\":24,\"offset\":763},\"end\":{\"line\":25,\"col\":80,\"offset\":819}},\"\\\"SELECT * FROM cat_pictures WHERE name = '\\\" + name + \\\"'\\\"\"]]},\"engine_kind\":\"OSS\"}},{\"check_id\":\"java.lang.security.audit.object-deserialization.object-deserialization\",\"path\":\"insecure-java/src/main/java/com/example/insecurejava/UnsafeDeserializationController.java\",\"start\":{\"line\":16,\"col\":13,\"offset\":594},\"end\":{\"line\":16,\"col\":91,\"offset\":672},\"extra\":{\"metavars\":{},\"message\":\"Found object deserialization using ObjectInputStream. Deserializing entire Java objects is dangerous because malicious actors can create Java object streams with unintended consequences. Ensure that the objects being deserialized are not user-controlled. If this must be done, consider using HMACs to sign the data stream to make sure it is not tampered with, or consider only transmitting object fields and populating a new object.\",\"metadata\":{\"cwe\":[\"CWE-502: Deserialization of Untrusted Data\"],\"owasp\":[\"A08:2017 - Insecure Deserialization\",\"A08:2021 - Software and Data Integrity Failures\"],\"source-rule-url\":\"https://find-sec-bugs.github.io/bugs.htm#OBJECT_DESERIALIZATION\",\"references\":[\"https://www.owasp.org/index.php/Deserialization_of_untrusted_data\",\"https://www.oracle.com/java/technologies/javase/seccodeguide.html#8\"],\"category\":\"security\",\"technology\":[\"java\"],\"cwe2022-top25\":true,\"cwe2021-top25\":true,\"subcategory\":[\"audit\"],\"likelihood\":\"LOW\",\"impact\":\"HIGH\",\"confidence\":\"LOW\",\"license\":\"Semgrep Rules License v1.0. For more details, visit semgrep.dev/legal/rules-license\",\"vulnerability_class\":[\"Insecure Deserialization \"],\"source\":\"https://semgrep.dev/r/java.lang.security.audit.object-deserialization.object-deserialization\",\"shortlink\":\"https://sg.run/Ek0A\",\"semgrep.dev\":{\"rule\":{\"origin\":\"community\",\"r_id\":9181,\"rule_id\":\"GdU7py\",\"rv_id\":945687,\"url\":\"https://semgrep.dev/playground/r/bZTXw4q/java.lang.security.audit.object-deserialization.object-deserialization\",\"version_id\":\"bZTXw4q\"}}},\"severity\":\"WARNING\",\"fingerprint\":\"774378c1d79256d5bab570074c4a6bf6703250887fca212f1a813ada0f8d5de5e786961d4f0b746e5f6292cc9b46c41ca4308c9367ddf6932267ba763012620e_0\",\"lines\":\" ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(data));\",\"is_ignored\":false,\"validation_state\":\"NO_VALIDATOR\",\"engine_kind\":\"OSS\"}},{\"check_id\":\"java.spring.security.objectinputstream-deserialization-spring.objectinputstream-deserialization-spring\",\"path\":\"insecure-java/src/main/java/com/example/insecurejava/UnsafeDeserializationController.java\",\"start\":{\"line\":16,\"col\":59,\"offset\":640},\"end\":{\"line\":16,\"col\":89,\"offset\":670},\"extra\":{\"metavars\":{\"$1\":{\"start\":{\"line\":1,\"col\":1,\"offset\":0},\"end\":{\"line\":1,\"col\":12,\"offset\":11},\"abstract_content\":\"RequestBody\"},\"$RET\":{\"start\":{\"line\":14,\"col\":12,\"offset\":495},\"end\":{\"line\":14,\"col\":34,\"offset\":517},\"abstract_content\":\"ResponseEntity\"},\"$METHOD\":{\"start\":{\"line\":14,\"col\":35,\"offset\":518},\"end\":{\"line\":14,\"col\":56,\"offset\":539},\"abstract_content\":\"unsafeDeserialization\"},\"$REQ\":{\"start\":{\"line\":14,\"col\":58,\"offset\":541},\"end\":{\"line\":14,\"col\":69,\"offset\":552},\"abstract_content\":\"RequestBody\"},\"$TYPE\":{\"start\":{\"line\":14,\"col\":70,\"offset\":553},\"end\":{\"line\":14,\"col\":76,\"offset\":559},\"abstract_content\":\"byte[]\"},\"$SOURCE\":{\"start\":{\"line\":14,\"col\":77,\"offset\":560},\"end\":{\"line\":14,\"col\":81,\"offset\":564},\"abstract_content\":\"data\"},\"$IN\":{\"start\":{\"line\":16,\"col\":59,\"offset\":640},\"end\":{\"line\":16,\"col\":89,\"offset\":670},\"abstract_content\":\"new ByteArrayInputStream(data)\"}},\"message\":\"The application may convert user-controlled data into an object, which can lead to an insecure deserialization vulnerability. An attacker can create a malicious serialized object, pass it to the application, and take advantage of the deserialization process to perform Denial-of-service (DoS), Remote code execution (RCE), or bypass access control measures. To prevent this vulnerability, leverage data formats such as JSON or XML as safer alternatives. If you need to deserialize user input in a specific format, consider digitally signing the data before serialization to prevent tampering. For more information, see: [Deserialization prevention](https://cheatsheetseries.owasp.org/cheatsheets/Deserialization_Cheat_Sheet.html) We do not recommend deserializing untrusted data with the `ObjectInputStream`. If you must, you can try overriding the `ObjectInputStream#resolveClass()` method or using a safe replacement for the generic `readObject()` method.\",\"metadata\":{\"likelihood\":\"MEDIUM\",\"impact\":\"HIGH\",\"confidence\":\"HIGH\",\"category\":\"security\",\"subcategory\":[\"vuln\"],\"cwe\":[\"CWE-502: Deserialization of Untrusted Data\"],\"cwe2020-top25\":true,\"cwe2021-top25\":true,\"cwe2022-top25\":true,\"display-name\":\"Unsafe Deserialization with Spring\",\"functional-categories\":[\"deserialization::sink::load-object::apache.commons\",\"deserialization::sink::load-object::java.io\",\"web::source::cookie::Spring\",\"web::source::header::Spring\",\"web::source::http-body::Spring\",\"web::source::http-params::Spring\",\"web::source::url-path-params::Spring\"],\"owasp\":[\"A08:2017 - Insecure Deserialization\",\"A08:2021 - Software and Data Integrity Failures\"],\"references\":[\"https://owasp.org/Top10/A08_2021-Software_and_Data_Integrity_Failures\"],\"supersedes\":[\"java.servlets.security.objectinputstream-deserialization-servlets.objectinputstream-deserialization-servlets\"],\"technology\":[\"Spring\",\"java\"],\"license\":\"Semgrep Rules License v1.0. For more details, visit semgrep.dev/legal/rules-license\",\"vulnerability_class\":[\"Insecure Deserialization \"],\"source\":\"https://semgrep.dev/r/java.spring.security.objectinputstream-deserialization-spring.objectinputstream-deserialization-spring\",\"shortlink\":\"https://sg.run/n1rY\",\"semgrep.dev\":{\"rule\":{\"origin\":\"pro_rules\",\"r_id\":46836,\"rule_id\":\"x8UbG3\",\"rv_id\":973726,\"url\":\"https://semgrep.dev/playground/r/44TZ832/java.spring.security.objectinputstream-deserialization-spring.objectinputstream-deserialization-spring\",\"version_id\":\"44TZ832\"}}},\"severity\":\"ERROR\",\"fingerprint\":\"cf7d59dc3cc6ec8769d1ad54d6b20023fdc6a24ee7ca6c8f25038ac25f17038a6b41f6fdc82c002123e671f0a1de733e48b7071ad905fe83c69c36be56df73b4_0\",\"lines\":\" ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(data));\",\"is_ignored\":false,\"validation_state\":\"NO_VALIDATOR\",\"dataflow_trace\":{\"taint_source\":[\"CliLoc\",[{\"path\":\"insecure-java/src/main/java/com/example/insecurejava/UnsafeDeserializationController.java\",\"start\":{\"line\":14,\"col\":77,\"offset\":560},\"end\":{\"line\":14,\"col\":81,\"offset\":564}},\"data\"]],\"intermediate_vars\":[{\"location\":{\"path\":\"insecure-java/src/main/java/com/example/insecurejava/UnsafeDeserializationController.java\",\"start\":{\"line\":14,\"col\":77,\"offset\":560},\"end\":{\"line\":14,\"col\":81,\"offset\":564}},\"content\":\"data\"}],\"taint_sink\":[\"CliLoc\",[{\"path\":\"insecure-java/src/main/java/com/example/insecurejava/UnsafeDeserializationController.java\",\"start\":{\"line\":16,\"col\":59,\"offset\":640},\"end\":{\"line\":16,\"col\":89,\"offset\":670}},\"new ByteArrayInputStream(data)\"]]},\"engine_kind\":\"OSS\"}},{\"check_id\":\"java.lang.security.audit.active-debug-code-printstacktrace.active-debug-code-printstacktrace\",\"path\":\"insecure-java/src/main/java/com/example/insecurejava/UnsafeDeserializationController.java\",\"start\":{\"line\":20,\"col\":13,\"offset\":870},\"end\":{\"line\":20,\"col\":32,\"offset\":889},\"extra\":{\"metavars\":{\"$EXCEPTION\":{\"start\":{\"line\":20,\"col\":13,\"offset\":870},\"end\":{\"line\":20,\"col\":14,\"offset\":871},\"abstract_content\":\"e\"}},\"message\":\"Possible active debug code detected. Deploying an application with debug code can create unintended entry points or expose sensitive information.\",\"metadata\":{\"likelihood\":\"LOW\",\"impact\":\"LOW\",\"confidence\":\"MEDIUM\",\"category\":\"security\",\"subcategory\":[\"audit\"],\"cwe\":[\"CWE-489: Active Debug Code\"],\"functional-categories\":[\"debug::search::active-debug-code::java.lang\"],\"owasp\":[\"A10:2004 - Insecure Configuration Management\",\"A06:2017 - Security Misconfiguration\",\"A05:2021 - Security Misconfiguration\"],\"references\":[\"https://cwe.mitre.org/data/definitions/489.html\",\"https://www.acunetix.com/vulnerabilities/web/stack-trace-disclosure-java/\",\"https://owasp.org/www-project-web-security-testing-guide/v41/4-Web_Application_Security_Testing/08-Testing_for_Error_Handling/02-Testing_for_Stack_Traces\",\"https://www.securecodewarrior.com/blog/coders-conquer-security-share-learn-series-information-exposure\"],\"technology\":[\"java\"],\"license\":\"Semgrep Rules License v1.0. For more details, visit semgrep.dev/legal/rules-license\",\"vulnerability_class\":[\"Active Debug Code\"],\"source\":\"https://semgrep.dev/r/java.lang.security.audit.active-debug-code-printstacktrace.active-debug-code-printstacktrace\",\"shortlink\":\"https://sg.run/4K8z\",\"semgrep.dev\":{\"rule\":{\"origin\":\"pro_rules\",\"r_id\":27144,\"rule_id\":\"v8U0rZ\",\"rv_id\":947426,\"url\":\"https://semgrep.dev/playground/r/GxTP0lB/java.lang.security.audit.active-debug-code-printstacktrace.active-debug-code-printstacktrace\",\"version_id\":\"GxTP0lB\"}}},\"severity\":\"WARNING\",\"fingerprint\":\"2f2eab275674c6639e50192e695448a7c772946f53353aaee757181220ac95afd0f966ae7a8030ed35c10335559cfd3dc575ef1b0469ca831144c249ce451bd9_0\",\"lines\":\" e.printStackTrace();\",\"is_ignored\":false,\"validation_state\":\"NO_VALIDATOR\",\"engine_kind\":\"OSS\"}},{\"check_id\":\"python.django.security.django-no-csrf-token.django-no-csrf-token\",\"path\":\"insecure-java/src/main/resources/templates/addComment.html\",\"start\":{\"line\":10,\"col\":5,\"offset\":425},\"end\":{\"line\":14,\"col\":12,\"offset\":705},\"extra\":{\"metavars\":{\"$1\":{\"start\":{\"line\":1,\"col\":1,\"offset\":0},\"end\":{\"line\":1,\"col\":5,\"offset\":4},\"abstract_content\":\"post\"},\"$METHOD\":{\"start\":{\"line\":10,\"col\":57,\"offset\":477},\"end\":{\"line\":10,\"col\":61,\"offset\":481},\"abstract_content\":\"post\"}},\"message\":\"Manually-created forms in django templates should specify a csrf_token to prevent CSRF attacks.\",\"metadata\":{\"category\":\"security\",\"cwe\":\"CWE-352: Cross-Site Request Forgery (CSRF)\",\"references\":[\"https://docs.djangoproject.com/en/4.2/howto/csrf/\"],\"confidence\":\"MEDIUM\",\"likelihood\":\"MEDIUM\",\"impact\":\"MEDIUM\",\"subcategory\":[\"audit\"],\"technology\":[\"django\"],\"license\":\"Semgrep Rules License v1.0. For more details, visit semgrep.dev/legal/rules-license\",\"vulnerability_class\":[\"Cross-Site Request Forgery (CSRF)\"],\"source\":\"https://semgrep.dev/r/python.django.security.django-no-csrf-token.django-no-csrf-token\",\"shortlink\":\"https://sg.run/N0Bp\",\"semgrep.dev\":{\"rule\":{\"origin\":\"community\",\"r_id\":73471,\"rule_id\":\"PeUyYG\",\"rv_id\":946160,\"url\":\"https://semgrep.dev/playground/r/BjT1NRl/python.django.security.django-no-csrf-token.django-no-csrf-token\",\"version_id\":\"BjT1NRl\"}}},\"severity\":\"WARNING\",\"fingerprint\":\"5195968eb1be4ef8a2cfa22014b4dca0bacb3cf656e20ede1b9f6636541b678ca576e1417883fcaadd8acac0ab3296c32e9068ecb662d0b91e386e823c8d43df_0\",\"lines\":\"
\\n
\\n
\\n \\n
\",\"is_ignored\":false,\"validation_state\":\"NO_VALIDATOR\",\"engine_kind\":\"OSS\"}},{\"check_id\":\"python.django.security.django-no-csrf-token.django-no-csrf-token\",\"path\":\"insecure-java/src/main/resources/templates/comments.html\",\"start\":{\"line\":13,\"col\":13,\"offset\":452},\"end\":{\"line\":16,\"col\":20,\"offset\":693},\"extra\":{\"metavars\":{\"$1\":{\"start\":{\"line\":1,\"col\":1,\"offset\":0},\"end\":{\"line\":1,\"col\":5,\"offset\":4},\"abstract_content\":\"post\"},\"$METHOD\":{\"start\":{\"line\":13,\"col\":68,\"offset\":507},\"end\":{\"line\":13,\"col\":72,\"offset\":511},\"abstract_content\":\"post\"}},\"message\":\"Manually-created forms in django templates should specify a csrf_token to prevent CSRF attacks.\",\"metadata\":{\"category\":\"security\",\"cwe\":\"CWE-352: Cross-Site Request Forgery (CSRF)\",\"references\":[\"https://docs.djangoproject.com/en/4.2/howto/csrf/\"],\"confidence\":\"MEDIUM\",\"likelihood\":\"MEDIUM\",\"impact\":\"MEDIUM\",\"subcategory\":[\"audit\"],\"technology\":[\"django\"],\"license\":\"Semgrep Rules License v1.0. For more details, visit semgrep.dev/legal/rules-license\",\"vulnerability_class\":[\"Cross-Site Request Forgery (CSRF)\"],\"source\":\"https://semgrep.dev/r/python.django.security.django-no-csrf-token.django-no-csrf-token\",\"shortlink\":\"https://sg.run/N0Bp\",\"semgrep.dev\":{\"rule\":{\"origin\":\"community\",\"r_id\":73471,\"rule_id\":\"PeUyYG\",\"rv_id\":946160,\"url\":\"https://semgrep.dev/playground/r/BjT1NRl/python.django.security.django-no-csrf-token.django-no-csrf-token\",\"version_id\":\"BjT1NRl\"}}},\"severity\":\"WARNING\",\"fingerprint\":\"83efea89720688f163f6bb09d1273d2c4207b38c65d2664660a5f8fa1ebbf337f1ffd9dbcb0351abbd51e711b53269ab547017075f90c945a0ea8c648efe78cf_0\",\"lines\":\"
\\n \\n \\n
\",\"is_ignored\":false,\"validation_state\":\"NO_VALIDATOR\",\"engine_kind\":\"OSS\"}},{\"check_id\":\"python.django.security.django-no-csrf-token.django-no-csrf-token\",\"path\":\"insecure-java/src/main/resources/templates/csrf_attack.html\",\"start\":{\"line\":9,\"col\":5,\"offset\":231},\"end\":{\"line\":11,\"col\":12,\"offset\":381},\"extra\":{\"metavars\":{\"$1\":{\"start\":{\"line\":1,\"col\":1,\"offset\":0},\"end\":{\"line\":1,\"col\":5,\"offset\":4},\"abstract_content\":\"post\"},\"$METHOD\":{\"start\":{\"line\":9,\"col\":64,\"offset\":290},\"end\":{\"line\":9,\"col\":68,\"offset\":294},\"abstract_content\":\"post\"}},\"message\":\"Manually-created forms in django templates should specify a csrf_token to prevent CSRF attacks.\",\"metadata\":{\"category\":\"security\",\"cwe\":\"CWE-352: Cross-Site Request Forgery (CSRF)\",\"references\":[\"https://docs.djangoproject.com/en/4.2/howto/csrf/\"],\"confidence\":\"MEDIUM\",\"likelihood\":\"MEDIUM\",\"impact\":\"MEDIUM\",\"subcategory\":[\"audit\"],\"technology\":[\"django\"],\"license\":\"Semgrep Rules License v1.0. For more details, visit semgrep.dev/legal/rules-license\",\"vulnerability_class\":[\"Cross-Site Request Forgery (CSRF)\"],\"source\":\"https://semgrep.dev/r/python.django.security.django-no-csrf-token.django-no-csrf-token\",\"shortlink\":\"https://sg.run/N0Bp\",\"semgrep.dev\":{\"rule\":{\"origin\":\"community\",\"r_id\":73471,\"rule_id\":\"PeUyYG\",\"rv_id\":946160,\"url\":\"https://semgrep.dev/playground/r/BjT1NRl/python.django.security.django-no-csrf-token.django-no-csrf-token\",\"version_id\":\"BjT1NRl\"}}},\"severity\":\"WARNING\",\"fingerprint\":\"a0bb982292e4d85d46ab7d43847c828d7cd9f14c12c773fbbe8ef38baec3a0a1e928441af3b460a47479a4e9b02cf13d7a298d0bc43ff6e93fcd5e5bd6f466e5_0\",\"lines\":\"
\\n \\n
\",\"is_ignored\":false,\"validation_state\":\"NO_VALIDATOR\",\"engine_kind\":\"OSS\"}},{\"check_id\":\"python.django.security.django-no-csrf-token.django-no-csrf-token\",\"path\":\"insecure-java/src/main/resources/templates/delete.html\",\"start\":{\"line\":10,\"col\":5,\"offset\":366},\"end\":{\"line\":13,\"col\":12,\"offset\":562},\"extra\":{\"metavars\":{\"$1\":{\"start\":{\"line\":1,\"col\":1,\"offset\":0},\"end\":{\"line\":1,\"col\":5,\"offset\":4},\"abstract_content\":\"post\"},\"$METHOD\":{\"start\":{\"line\":10,\"col\":53,\"offset\":414},\"end\":{\"line\":10,\"col\":57,\"offset\":418},\"abstract_content\":\"post\"}},\"message\":\"Manually-created forms in django templates should specify a csrf_token to prevent CSRF attacks.\",\"metadata\":{\"category\":\"security\",\"cwe\":\"CWE-352: Cross-Site Request Forgery (CSRF)\",\"references\":[\"https://docs.djangoproject.com/en/4.2/howto/csrf/\"],\"confidence\":\"MEDIUM\",\"likelihood\":\"MEDIUM\",\"impact\":\"MEDIUM\",\"subcategory\":[\"audit\"],\"technology\":[\"django\"],\"license\":\"Semgrep Rules License v1.0. For more details, visit semgrep.dev/legal/rules-license\",\"vulnerability_class\":[\"Cross-Site Request Forgery (CSRF)\"],\"source\":\"https://semgrep.dev/r/python.django.security.django-no-csrf-token.django-no-csrf-token\",\"shortlink\":\"https://sg.run/N0Bp\",\"semgrep.dev\":{\"rule\":{\"origin\":\"community\",\"r_id\":73471,\"rule_id\":\"PeUyYG\",\"rv_id\":946160,\"url\":\"https://semgrep.dev/playground/r/BjT1NRl/python.django.security.django-no-csrf-token.django-no-csrf-token\",\"version_id\":\"BjT1NRl\"}}},\"severity\":\"WARNING\",\"fingerprint\":\"67d4cf1e50c6d8501e12adbe719f860782fb3b95872d174bd05fc16b23a18b575bea13c5bfa1d015c18ca55d2227d050dc25c734e4a26c4ebaa21c6242e07c20_0\",\"lines\":\"
\\n
\\n \\n
\",\"is_ignored\":false,\"validation_state\":\"NO_VALIDATOR\",\"engine_kind\":\"OSS\"}},{\"check_id\":\"python.django.security.django-no-csrf-token.django-no-csrf-token\",\"path\":\"insecure-java/src/main/resources/templates/editProfile.html\",\"start\":{\"line\":10,\"col\":5,\"offset\":374},\"end\":{\"line\":15,\"col\":12,\"offset\":751},\"extra\":{\"metavars\":{\"$1\":{\"start\":{\"line\":1,\"col\":1,\"offset\":0},\"end\":{\"line\":1,\"col\":5,\"offset\":4},\"abstract_content\":\"post\"},\"$METHOD\":{\"start\":{\"line\":10,\"col\":58,\"offset\":427},\"end\":{\"line\":10,\"col\":62,\"offset\":431},\"abstract_content\":\"post\"}},\"message\":\"Manually-created forms in django templates should specify a csrf_token to prevent CSRF attacks.\",\"metadata\":{\"category\":\"security\",\"cwe\":\"CWE-352: Cross-Site Request Forgery (CSRF)\",\"references\":[\"https://docs.djangoproject.com/en/4.2/howto/csrf/\"],\"confidence\":\"MEDIUM\",\"likelihood\":\"MEDIUM\",\"impact\":\"MEDIUM\",\"subcategory\":[\"audit\"],\"technology\":[\"django\"],\"license\":\"Semgrep Rules License v1.0. For more details, visit semgrep.dev/legal/rules-license\",\"vulnerability_class\":[\"Cross-Site Request Forgery (CSRF)\"],\"source\":\"https://semgrep.dev/r/python.django.security.django-no-csrf-token.django-no-csrf-token\",\"shortlink\":\"https://sg.run/N0Bp\",\"semgrep.dev\":{\"rule\":{\"origin\":\"community\",\"r_id\":73471,\"rule_id\":\"PeUyYG\",\"rv_id\":946160,\"url\":\"https://semgrep.dev/playground/r/BjT1NRl/python.django.security.django-no-csrf-token.django-no-csrf-token\",\"version_id\":\"BjT1NRl\"}}},\"severity\":\"WARNING\",\"fingerprint\":\"50a333ae413c799b7d987efae64cf4bb1fd7dc290892f4dee02d5a3f60d4dcd449315a3e482a24eeca40411070879da85104760ab26a458c5c86ef7258207a34_0\",\"lines\":\"
\\n \\n
\\n
\\n \\n
\",\"is_ignored\":false,\"validation_state\":\"NO_VALIDATOR\",\"engine_kind\":\"OSS\"}},{\"check_id\":\"python.django.security.django-no-csrf-token.django-no-csrf-token\",\"path\":\"insecure-java/src/main/resources/templates/login.html\",\"start\":{\"line\":10,\"col\":5,\"offset\":362},\"end\":{\"line\":14,\"col\":12,\"offset\":662},\"extra\":{\"metavars\":{\"$1\":{\"start\":{\"line\":1,\"col\":1,\"offset\":0},\"end\":{\"line\":1,\"col\":5,\"offset\":4},\"abstract_content\":\"post\"},\"$METHOD\":{\"start\":{\"line\":10,\"col\":52,\"offset\":409},\"end\":{\"line\":10,\"col\":56,\"offset\":413},\"abstract_content\":\"post\"}},\"message\":\"Manually-created forms in django templates should specify a csrf_token to prevent CSRF attacks.\",\"metadata\":{\"category\":\"security\",\"cwe\":\"CWE-352: Cross-Site Request Forgery (CSRF)\",\"references\":[\"https://docs.djangoproject.com/en/4.2/howto/csrf/\"],\"confidence\":\"MEDIUM\",\"likelihood\":\"MEDIUM\",\"impact\":\"MEDIUM\",\"subcategory\":[\"audit\"],\"technology\":[\"django\"],\"license\":\"Semgrep Rules License v1.0. For more details, visit semgrep.dev/legal/rules-license\",\"vulnerability_class\":[\"Cross-Site Request Forgery (CSRF)\"],\"source\":\"https://semgrep.dev/r/python.django.security.django-no-csrf-token.django-no-csrf-token\",\"shortlink\":\"https://sg.run/N0Bp\",\"semgrep.dev\":{\"rule\":{\"origin\":\"community\",\"r_id\":73471,\"rule_id\":\"PeUyYG\",\"rv_id\":946160,\"url\":\"https://semgrep.dev/playground/r/BjT1NRl/python.django.security.django-no-csrf-token.django-no-csrf-token\",\"version_id\":\"BjT1NRl\"}}},\"severity\":\"WARNING\",\"fingerprint\":\"593d8048e3230f2f0fc122a66bf700f2fc4082170f52d319ec60abf29e3c47dcbe4341103ad3aace692bc30ca3a768fa687c5b5fb022c6b7b875bdf6aab94ccd_0\",\"lines\":\"
\\n
\\n
\\n \\n
\",\"is_ignored\":false,\"validation_state\":\"NO_VALIDATOR\",\"engine_kind\":\"OSS\"}},{\"check_id\":\"python.django.security.django-no-csrf-token.django-no-csrf-token\",\"path\":\"insecure-java/src/main/resources/templates/register.html\",\"start\":{\"line\":10,\"col\":5,\"offset\":383},\"end\":{\"line\":14,\"col\":12,\"offset\":689},\"extra\":{\"metavars\":{\"$1\":{\"start\":{\"line\":1,\"col\":1,\"offset\":0},\"end\":{\"line\":1,\"col\":5,\"offset\":4},\"abstract_content\":\"post\"},\"$METHOD\":{\"start\":{\"line\":10,\"col\":55,\"offset\":433},\"end\":{\"line\":10,\"col\":59,\"offset\":437},\"abstract_content\":\"post\"}},\"message\":\"Manually-created forms in django templates should specify a csrf_token to prevent CSRF attacks.\",\"metadata\":{\"category\":\"security\",\"cwe\":\"CWE-352: Cross-Site Request Forgery (CSRF)\",\"references\":[\"https://docs.djangoproject.com/en/4.2/howto/csrf/\"],\"confidence\":\"MEDIUM\",\"likelihood\":\"MEDIUM\",\"impact\":\"MEDIUM\",\"subcategory\":[\"audit\"],\"technology\":[\"django\"],\"license\":\"Semgrep Rules License v1.0. For more details, visit semgrep.dev/legal/rules-license\",\"vulnerability_class\":[\"Cross-Site Request Forgery (CSRF)\"],\"source\":\"https://semgrep.dev/r/python.django.security.django-no-csrf-token.django-no-csrf-token\",\"shortlink\":\"https://sg.run/N0Bp\",\"semgrep.dev\":{\"rule\":{\"origin\":\"community\",\"r_id\":73471,\"rule_id\":\"PeUyYG\",\"rv_id\":946160,\"url\":\"https://semgrep.dev/playground/r/BjT1NRl/python.django.security.django-no-csrf-token.django-no-csrf-token\",\"version_id\":\"BjT1NRl\"}}},\"severity\":\"WARNING\",\"fingerprint\":\"966463a3a41588664e521d7b9641485c1573953f142a6a46199e114a0dddb3815617a2b6c2ed33569aa81d0ae57e1af6704692f376df4d5f396d9fe9ebdc041e_0\",\"lines\":\"
\\n
\\n
\\n \\n
\",\"is_ignored\":false,\"validation_state\":\"NO_VALIDATOR\",\"engine_kind\":\"OSS\"}},{\"check_id\":\"python.django.security.django-no-csrf-token.django-no-csrf-token\",\"path\":\"insecure-java/src/main/resources/templates/search.html\",\"start\":{\"line\":10,\"col\":5,\"offset\":392},\"end\":{\"line\":13,\"col\":12,\"offset\":592},\"extra\":{\"metavars\":{\"$1\":{\"start\":{\"line\":1,\"col\":1,\"offset\":0},\"end\":{\"line\":1,\"col\":5,\"offset\":4},\"abstract_content\":\"post\"},\"$METHOD\":{\"start\":{\"line\":10,\"col\":53,\"offset\":440},\"end\":{\"line\":10,\"col\":57,\"offset\":444},\"abstract_content\":\"post\"}},\"message\":\"Manually-created forms in django templates should specify a csrf_token to prevent CSRF attacks.\",\"metadata\":{\"category\":\"security\",\"cwe\":\"CWE-352: Cross-Site Request Forgery (CSRF)\",\"references\":[\"https://docs.djangoproject.com/en/4.2/howto/csrf/\"],\"confidence\":\"MEDIUM\",\"likelihood\":\"MEDIUM\",\"impact\":\"MEDIUM\",\"subcategory\":[\"audit\"],\"technology\":[\"django\"],\"license\":\"Semgrep Rules License v1.0. For more details, visit semgrep.dev/legal/rules-license\",\"vulnerability_class\":[\"Cross-Site Request Forgery (CSRF)\"],\"source\":\"https://semgrep.dev/r/python.django.security.django-no-csrf-token.django-no-csrf-token\",\"shortlink\":\"https://sg.run/N0Bp\",\"semgrep.dev\":{\"rule\":{\"origin\":\"community\",\"r_id\":73471,\"rule_id\":\"PeUyYG\",\"rv_id\":946160,\"url\":\"https://semgrep.dev/playground/r/BjT1NRl/python.django.security.django-no-csrf-token.django-no-csrf-token\",\"version_id\":\"BjT1NRl\"}}},\"severity\":\"WARNING\",\"fingerprint\":\"b27e6297157b64351971325aa01d93bcbe09743a223a78cc98fad9eea9c1bdd310d078908dc9e0133d6ede7a975b687dcb74872bd980aeb587f2d07896a27f3d_0\",\"lines\":\"
\\n