{ "schema": "anticloud.tier-bench/1", "project": "PYTHON_API", "source": { "git": { "url": "https://github.com/china-testing/python-api-tesing", "head": "0b72e9f1776eced1ded90f67474f5f8d68511915", "sha_verified_from": "revendor 2026-10-15: GitHub API commit lookup", "previous_substitute": "https://github.com/china-testing/python-api-tesing" } }, "metrics": { "files_total": 3147, "source_files_scanned": 991, "lines_of_code": 119049, "languages": { ".md": 1698, ".py": 1167, ".png": 184, ".svg": 56, ".yml": 13, ".sh": 5, ".html": 5, ".js": 4, ".jpg": 4, "(none)": 3, ".css": 3, ".yaml": 1, ".cff": 1, ".toml": 1, ".lock": 1 } }, "licence": { "spdx": "MIT", "class": "A", "source_file": "LICENSE", "redistribution_allowed": true }, "dependencies": { "count": 6, "unique": 6, "by_ecosystem": { "pypi": 6 }, "list": [ { "ecosystem": "pypi", "name": "starlette", "version": ">=0.46.0", "source_file": "pyproject.toml", "raw": "starlette>=0.46.0" }, { "ecosystem": "pypi", "name": "pydantic", "version": ">=2.9.0", "source_file": "pyproject.toml", "raw": "pydantic>=2.9.0" }, { "ecosystem": "pypi", "name": "typing-extensions", "version": ">=4.8.0", "source_file": "pyproject.toml", "raw": "typing-extensions>=4.8.0" }, { "ecosystem": "pypi", "name": "typing-inspection", "version": ">=0.4.2", "source_file": "pyproject.toml", "raw": "typing-inspection>=0.4.2" }, { "ecosystem": "pypi", "name": "annotated-doc", "version": ">=0.0.2", "source_file": "pyproject.toml", "raw": "annotated-doc>=0.0.2" }, { "ecosystem": "pypi", "name": "opentelemetry-api", "version": ">=1.44.0", "source_file": "pyproject.toml", "raw": "opentelemetry-api>=1.44.0" } ] }, "owasp_top10": { "total_findings": 73, "files_with_findings": 68, "severity": { "high": 12, "medium": 0, "low": 61 }, "categories": { "A01-BrokenAccessControl": { "count": 0, "findings": [] }, "A02-CryptographicFailures": { "count": 0, "findings": [] }, "A03-Injection": { "count": 4, "findings": [ { "severity": "high", "file": "docs_src/sql_databases/tutorial001_an_py310.py", "line": 54, "cwe": "CWE-95", "snippet": "heroes = session.exec(select(Hero).offset(offset).limit(limit)).all()" }, { "severity": "high", "file": "docs_src/sql_databases/tutorial001_py310.py", "line": 50, "cwe": "CWE-95", "snippet": "heroes = session.exec(select(Hero).offset(offset).limit(limit)).all()" }, { "severity": "high", "file": "docs_src/sql_databases/tutorial002_an_py310.py", "line": 71, "cwe": "CWE-95", "snippet": "heroes = session.exec(select(Hero).offset(offset).limit(limit)).all()" }, { "severity": "high", "file": "docs_src/sql_databases/tutorial002_py310.py", "line": 68, "cwe": "CWE-95", "snippet": "heroes = session.exec(select(Hero).offset(offset).limit(limit)).all()" } ] }, "A04-InsecureDesign": { "count": 13, "findings": [ { "severity": "low", "file": "tests/test_compat.py", "line": 93, "cwe": "CWE-", "snippet": "# TODO: in theory this would allow declaring types that could be lists of bytes" }, { "severity": "low", "file": "tests/test_response_by_alias.py", "line": 19, "cwe": "CWE-", "snippet": "\"response_model_by_alias=False is basically a quick hack, to support \"" }, { "severity": "low", "file": "tests/test_schema_extra_examples.py", "line": 54, "cwe": "CWE-", "snippet": "# TODO: enable these tests once/if Form(embed=False) is supported" }, { "severity": "low", "file": "tests/test_tutorial/test_sql_databases/test_tutorial001.py", "line": 33, "cwe": "CWE-", "snippet": "# TODO: remove when updating SQL tutorial to use new lifespan API" }, { "severity": "low", "file": "tests/test_tutorial/test_sql_databases/test_tutorial002.py", "line": 33, "cwe": "CWE-", "snippet": "# TODO: remove when updating SQL tutorial to use new lifespan API" }, { "severity": "low", "file": "scripts/docs.py", "line": 749, "cwe": "CWE-", "snippet": "# File is inside a sub-package like docs_src/topic/app_xxx/..." }, { "severity": "low", "file": "fastapi/applications.py", "line": 923, "cwe": "CWE-", "snippet": "the generated OpenAPI. Have in mind that this is a hack. But if you" }, { "severity": "low", "file": "fastapi/encoders.py", "line": 58, "cwe": "CWE-", "snippet": "# TODO: pv2 should this return strings instead?" }, { "severity": "low", "file": "fastapi/routing.py", "line": 1260, "cwe": "CWE-", "snippet": "# TODO: Replace or deprecate this no-scope hook so included-route" }, { "severity": "low", "file": "fastapi/_compat/shared.py", "line": 187, "cwe": "CWE-", "snippet": "# TODO: remove this function once the required version of Pydantic fully" }, { "severity": "low", "file": "fastapi/_compat/v2.py", "line": 58, "cwe": "CWE-", "snippet": "# TODO: remove when this is merged (or equivalent): https://github.com/pydantic/pydantic/pull/12841" }, { "severity": "low", "file": "fastapi/openapi/utils.py", "line": 409, "cwe": "CWE-", "snippet": "# TODO: probably make status_code a default class attribute for all" }, { "severity": "low", "file": "fastapi/dependencies/utils.py", "line": 595, "cwe": "CWE-", "snippet": "# TODO: remove this parameter later, no longer used, not removing it yet as some" } ] }, "A05-SecurityMisconfiguration": { "count": 1, "findings": [ { "severity": "high", "file": "tests/test_tutorial/test_cors/test_tutorial001.py", "line": 6, "cwe": "CWE-942", "snippet": "def test_cors():" } ] }, "A06-VulnerableComponents": { "count": 0, "findings": [] }, "A07-AuthFailures": { "count": 7, "findings": [ { "severity": "high", "file": "tests/test_filter_pydantic_sub_model_pv2.py", "line": 34, "cwe": "CWE-798", "snippet": "return ModelC(username=\"test-user\", password=\"test-password\")" }, { "severity": "high", "file": "tests/test_response_model_data_filter.py", "line": 39, "cwe": "CWE-798", "snippet": "hashed_password=\"secrethashed\"," }, { "severity": "high", "file": "tests/test_response_model_data_filter_no_inheritance.py", "line": 41, "cwe": "CWE-798", "snippet": "hashed_password=\"secrethashed\"," }, { "severity": "high", "file": "tests/test_tutorial/test_security/test_tutorial004.py", "line": 25, "cwe": "CWE-798", "snippet": "def get_access_token(*, username=\"johndoe\", password=\"secret\", client: TestClient):" }, { "severity": "high", "file": "tests/test_tutorial/test_security/test_tutorial005.py", "line": 43, "cwe": "CWE-798", "snippet": "*, username=\"johndoe\", password=\"secret\", scope=None, client: TestClient" }, { "severity": "high", "file": "docs_src/app_testing/app_b_py310/main.py", "line": 4, "cwe": "CWE-798", "snippet": "fake_secret_token = \"coneofsilence\"" }, { "severity": "high", "file": "docs_src/app_testing/app_b_an_py310/main.py", "line": 6, "cwe": "CWE-798", "snippet": "fake_secret_token = \"coneofsilence\"" } ] }, "A08-SoftwareDataIntegrity": { "count": 38, "findings": [ { "severity": "low", "file": "tests/test_frontend.py", "line": 825, "cwe": "CWE-319", "snippet": "assert redirect.headers[\"location\"] == \"http://testserver/about/\"" }, { "severity": "low", "file": "tests/test_openapi_servers.py", "line": 9, "cwe": "CWE-319", "snippet": "\"url\": \"http://staging.localhost.tiangolo.com:8000\"," }, { "severity": "low", "file": "tests/test_router_include_context.py", "line": 736, "cwe": "CWE-319", "snippet": "client = TestClient(app, base_url=\"http://api.example.com\")" }, { "severity": "low", "file": "tests/test_tutorial/test_templates/test_tutorial001.py", "line": 23, "cwe": "CWE-319", "snippet": "b'