# Security Policy ## Supported Versions | Version | Supported | | :--- | :--- | | `0.1.x` | Yes | | `< 0.1.0` | No | ## Reporting a Vulnerability Please **do not** report security vulnerabilities through public GitHub issues. Instead, report them privately using either: 1. **GitHub Security Advisories** (preferred): open a private advisory at `https://github.com/cwj2001/pgbreaker/security/advisories/new`. 2. **Email**: send details to `2965241316@qq.com` with the subject prefix `[pgbreaker security]`. Please include: - PostgreSQL major/minor version and operating system/architecture - `pgbreaker` version or commit SHA - Minimal reproduction steps or SQL snippet - Expected impact (e.g., crash/DoS, privilege escalation, bypass, slot leak, or information disclosure) You can expect an initial acknowledgment within 3 business days and coordinated disclosure once a fix is verified. ## Security Model & Scope - **Privilege boundary**: `pgbreaker` runs inside PostgreSQL server processes (`shared_preload_libraries`). All 5 mutating control functions require `superuser()` in C in addition to `REVOKE ALL FROM PUBLIC` in SQL. Read-only observability views (`pgbreaker.rules`, `pgbreaker.status`) are granted exclusively to `pg_read_all_stats` (never `PUBLIC`), and `status.persist_path` redacts `$PGDATA` unless the caller also holds `pg_read_all_settings`. - **Schema installation guard**: `CREATE EXTENSION pgbreaker` refuses installation into an existing schema not owned by a superuser, granting `CREATE` to any non-superuser (direct or inherited), or containing pre-existing relations, functions, or types. - **Persistence safety**: `$PGDATA/pg_stat/pgbreaker.rules` is opened with `O_NONBLOCK` / `O_NOFOLLOW` and `S_ISREG` checks on startup, written via `O_CREAT | O_EXCL | O_NOFOLLOW` unique temporary files with CRC32C checksums, and fails open on corrupt or unreadable files without blocking PostgreSQL startup. - **Out of scope**: `pgbreaker` is an availability and load-shedding kernel primitive—not a SQL injection firewall, auditing system, or row/table access-control mechanism. Bugs in the `demo/` local Docker harness's hardcoded test passwords (`demo_password` / `app_pass`, bound strictly to container loopback `127.0.0.1` with no published host ports) are not production vulnerabilities.