codeql-config.yml 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. name: "Bambuddy CodeQL Configuration"
  2. # Uses the default query suite with accepted-risk exclusions.
  3. # Each exclusion is reviewed and documented below.
  4. query-filters:
  5. # ── Python Accepted Risk ─────────────────────────────────────
  6. # Log injection: All logging uses %s parameterized style.
  7. # Remaining findings are CodeQL taint-tracking printer/device data
  8. # to parameterized log args. Accepted risk for local network tool.
  9. - exclude:
  10. id: py/log-injection
  11. # Cyclic imports: SQLAlchemy ORM pattern — models import
  12. # database base class, database imports models for migrations.
  13. - exclude:
  14. id: py/cyclic-import
  15. - exclude:
  16. id: py/unsafe-cyclic-import
  17. # Unused local variables: Python _ prefix convention for
  18. # intentional discards (tuple unpacking, test fixture side effects).
  19. - exclude:
  20. id: py/unused-local-variable
  21. # Path injection: All paths validated — extension whitelists,
  22. # traversal checks (rejects .. / \), UUID-based naming, or
  23. # constructed from integer IDs in controlled base directories.
  24. - exclude:
  25. id: py/path-injection
  26. # Stack trace exposure: str(e) replaced with generic messages
  27. # in HTTP responses. Remaining findings are CodeQL tracing through
  28. # _update_status dict returns, not actual exposures.
  29. - exclude:
  30. id: py/stack-trace-exposure
  31. # Socket bind to 0.0.0.0: Virtual printer SSDP/discovery
  32. # services must bind all interfaces for LAN discoverability.
  33. - exclude:
  34. id: py/bind-socket-all-network-interfaces
  35. # SSRF: URLs come from admin-configured settings (external
  36. # cameras, Home Assistant, Tasmota). Validation added for scheme,
  37. # hostname, and metadata-service blocking.
  38. - exclude:
  39. id: py/partial-ssrf
  40. - exclude:
  41. id: py/full-ssrf
  42. # Unused global variables: False positives — module-level
  43. # cache variables written via `global` in one function, read in another.
  44. - exclude:
  45. id: py/unused-global-variable
  46. # Clear-text logging sensitive data: False positive —
  47. # `api_key` in firmware_check.py is a printer model identifier
  48. # string ("x1", "p1", "a1-mini"), not a secret.
  49. - exclude:
  50. id: py/clear-text-logging-sensitive-data
  51. # Clear-text storage sensitive data: JWT secret stored in
  52. # file with 0600 permissions. Standard for single-host deployment.
  53. - exclude:
  54. id: py/clear-text-storage-sensitive-data
  55. # Weak hashing on sensitive data: MD5 used with
  56. # usedforsecurity=False for AMS tray fingerprinting, not security.
  57. - exclude:
  58. id: py/weak-sensitive-data-hashing
  59. # Catch base exception: In frontend/node_modules third-party
  60. # code (flatted/python/flatted.py), outside our control.
  61. - exclude:
  62. id: py/catch-base-exception
  63. # ── JavaScript Accepted Risk ─────────────────────────────────
  64. # XSS through DOM: False positives —
  65. # 1. coverage/sorter.js: generated Istanbul coverage report
  66. # 2. TimelapseEditorModal.tsx: URL.createObjectURL(file) creates
  67. # a safe blob: URL used as <audio src>, not HTML injection.
  68. - exclude:
  69. id: js/xss-through-dom