| 标题 | sosedoff Pgweb 0.17.0 Missing Authentication |
|---|
| 描述 | Pgweb 0Day: Unauthenticated SQL Access and Conditional Database-Host Command Execution
Pgweb 0.17.0 permits unauthenticated SQL execution through GET /api/query when its API is exposed without HTTP authentication and a PostgreSQL connection is active. If the connection uses a PostgreSQL superuser or a role with pg_execute_server_program, an attacker can execute OS commands as the PostgreSQL server process user on the database host.
Affected configuration: Pgweb 0.17.0 with a reachable API, no HTTP authentication, and an active PostgreSQL connection. Pgweb enables BasicAuth only when both AuthUser and AuthPass are set. The GET /api/query route forwards submitted SQL to the connected database without restricting the statement type.
A visitor can therefore run SQL using the configured database role. PostgreSQL COPY ... TO PROGRAM executes commands on the database server when that role is a superuser or has pg_execute_server_program. The database host may be separate from the Pgweb host.
The complete chain was verified on three Pgweb 0.17.0 instances using superuser database connections. Target identities and database identifiers have been redacted.
Relevant source:
https://github.com/sosedoff/pgweb/blob/v0.17.0/pkg/cli/cli.go#L197-L210
https://github.com/sosedoff/pgweb/blob/v0.17.0/pkg/api/routes.go#L21-L57
https://github.com/sosedoff/pgweb/blob/v0.17.0/pkg/api/api.go#L310-L320
https://www.postgresql.org/docs/current/sql-copy.html
The report and redacted evidence are already public:
https://github.com/QiLiLab/pgweb-unauthenticated-sql-rce
This /api/query chain differs from the /api/connect issue discussed in https://github.com/sosedoff/pgweb/issues/869.
|
|---|
| 来源 | ⚠️ https://github.com/QiLiLab/pgweb-unauthenticated-sql-rce |
|---|
| 用户 | Huaike (UID 102614) |
|---|
| 提交 | 2026-10-29 12時30分 (1 月前) |
|---|
| 管理 | 2026-11-29 20時49分 (1 month later) |
|---|
| 状态 | 已接受 |
|---|
| VulDB条目 | 445253 [sosedoff pgweb 直到 0.17.0 API pkg/api/routes.go RunQuery query 弱身份验证] |
|---|
| 积分 | 20 |
|---|