T08 · Insecure Dependencies
Warning
- Location
- reference/setup-postgres-mcp/setup-postgres-mcp.md:74
- Finding
- Mutable and Unpinned Third-Party Components Can Change After Review<![CDATA[ ## Vulnerability Details **File Location**: `reference/setup-postgres-mcp/setup-postgres-mcp.md`, lines 74–137 **Additional Locations**: `reference/setup-postgres-mcp/setup-postgres-mcp.md`, lines 106–116 and 134–137 **Vulnerability Type**: Unpinned third-party dependencies and mutable container images **Risk Level**: Medium ### Vulnerable Code ```bash docker run -i --rm \ ghcr.io/crystaldba/postgres-mcp:latest \ "postgresql://user:pass@host:5432/dbname" ``` ```bash docker run -d -p 8000:8000 \ ghcr.io/crystaldba/postgres-mcp:latest \ --transport sse \ --port 8000 \ "postgresql://user:pass@host:5432/dbname" ``` ```bash brew install uv ``` ```bash pip install uv ``` ```bash pipx install uv ``` ```bash # From PyPI uv pip install postgres-mcp # Or from source git clone https://github.com/crystaldba/postgres-mcp.git cd postgres-mcp uv pip install -e . uv sync ``` ```bash pipx install postgres-mcp postgres-mcp "postgresql://user:pass@host:5432/dbname" ``` ### Technical Analysis The setup instructions install and execute third-party components without pinning them to immutable, reviewed versions: - The `latest` container tag is mutable and can point to a different image at any time. - PyPI installations do not specify package versions or verify package hashes. - The Git repository is cloned without checking out a reviewed commit or signed release. - The `uv` installer itself is installed without a version constraint. Consequently, the code ultimately executed by users can differ from the code that existed when this Skill was audited. This creates a supply-chain trust gap. If an upstream package, release process, repository, registry account, or maintainer account is compromised, a modified component could execute with access to the supplied database connection string and network connectivity. This finding does not establish that the current upstream project is malicious. The vulnerability is the absence of immutable dependency sel ...[truncated 1495 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Replace mutable container tags with reviewed immutable digests: ```bash docker run -i --rm \ ghcr.io/crystaldba/postgres-mcp@sha256:<reviewed-digest> \ "${DATABASE_URL}" ``` 2. Pin exact Python package versions and use hash verification: ```text postgres-mcp==<reviewed-version> --hash=sha256:<reviewed-hash> uv==<reviewed-version> --hash=sha256:<reviewed-hash> ``` Install with a locked requirements file and require hashes. 3. For source installations, check out a specific reviewed commit or signed tag: ```bash git clone https://github.com/crystaldba/postgres-mcp.git cd postgres-mcp git checkout --detach <reviewed-commit> git verify-commit <reviewed-commit> ``` 4. Publish the expected package versions, image digests, checksums, and signing identities in the setup guide. 5. Use signature or provenance verification where supported, such as Sigstore/Cosign for container images and trusted package-index verification for Python packages. 6. Run the service with a dedicated least-privilege database role, preferably read-only unless write access is explicitly required. 7. Re-review and intentionally update all pinned artifacts through a controlled dependency-update process. ]]>
