Skip to main content

Запросы Python для анализа CodeQL

Изучите запросы, которые CodeQL используются для анализа кода, написанного на Python при выборе default или наборе security-extended запросов.

Кто эту функцию можно использовать?

Code scanning доступен для всех общедоступных репозиториев на Чтобы использовать code scanning в частном репозитории, принадлежащем организации, необходима лицензия на GitHub Advanced Security. Дополнительные сведения см. в разделе Сведения о GitHub Advanced Security.

CodeQL includes many queries for analyzing Python code. All queries in the default query suite are run by default. If you choose to use the security-extended query suite, additional queries are run. For more information, see "CodeQL query suites."

Built-in queries for Python analysis

This table lists the queries available with the latest release of the CodeQL action and CodeQL CLI. For more information, see CodeQL change logs in the CodeQL documentation site.

Note: GitHub autofix for code scanning is in beta. Functionality and documentation are subject to change. During this phase, the feature is restricted to JavaScript, TypeScript, Python, and Java alerts identified by CodeQL. If you have an enterprise account and use GitHub Advanced Security, your enterprise has access to the beta.

Query nameRelated CWEsDefaultExtendedAutofix
Accepting unknown SSH host keys when using Paramiko295
Bad HTML filtering regexp116, 020, 185, 186
Binding a socket to all network interfaces200
Clear-text logging of sensitive information312, 359, 532
Clear-text storage of sensitive information312, 315, 359
Code injection094, 095, 116
CSRF protection weakened or disabled352
Default version of SSL/TLS may be insecure327
Deserialization of user-controlled data502
Flask app is run in debug mode215, 489
Full server-side request forgery918
Incomplete regular expression for hostnames020
Incomplete URL substring sanitization20
Inefficient regular expression1333, 730, 400
Information exposure through an exception209, 497
Insecure temporary file377
LDAP query built from user-controlled sources090
NoSQL Injection943
Overly permissive regular expression range020
PAM authorization bypass due to incorrect usage285
Polynomial regular expression used on uncontrolled data1333, 730, 400
Reflected server-side cross-site scripting079, 116
Regular expression injection730, 400
SQL query built from user-controlled sources089
Uncontrolled command line078, 088
Uncontrolled data used in path expression022, 023, 036, 073, 099
URL redirection from remote source601
Use of a broken or weak cryptographic algorithm327
Use of a broken or weak cryptographic hashing algorithm on sensitive data327, 328, 916
Use of insecure SSL/TLS version327
Use of weak cryptographic key326
XML external entity expansion611, 827
XML internal entity expansion776, 400
XPath query built from user-controlled sources643
Arbitrary file write during tarfile extraction022
Hard-coded credentials259, 321, 798
Jinja2 templating with autoescape=False079
Log Injection117
Overly permissive file permissions732
Partial server-side request forgery918
Request without certificate validation295
Unsafe shell command constructed from library input078, 088, 073