Skip to content

Security Vulnerabilities in PostgreSQL Image: Request for Guidance #138

@SanduDS

Description

@SanduDS

Issue Description

We are using the PostgreSQL image (17) based on Debian OS (Bookworm) with CloudNativePG in our Kubernetes cluster. While scanning the image for vulnerabilities, we identified several critical issues. We need guidance from the CNPG community to address these vulnerabilities in the image version used by CNPG.

Critical Vulnerabilities Identified

  1. CVE-2023-45853:

    • Package: zlib1g
    • Description: Integer overflow in zipOpenNewFileInZip4_6 leads to a heap-based buffer overflow.
    • Severity: Critical
    • Status: will_not_fix
  2. CVE-2023-24538:

    • Package: Go runtime (html/template)
    • Description: Backticks are not treated as string delimiters, which may allow code injection.
    • Severity: Critical
    • Status: Fixed in Go v1.18.2, v1.19.8, v1.20.3
  3. CVE-2023-24540:

    • Package: Go runtime (html/template)
    • Description: Improper handling of JavaScript whitespace could allow XSS attacks.
    • Severity: Critical
    • Status: Fixed in Go v1.19.9, v1.20.4
  4. CVE-2024-24790:

    • Package: Go runtime (net/netip)
    • Description: Unexpected behavior in Is methods for IPv4-mapped IPv6 addresses could bypass IP-based restrictions.
    • Severity: High
    • Status: Fixed in Go v1.21.11, v1.22.4

Impact on Cluster Security

While PostgreSQL itself is not directly impacted, associated vulnerabilities in the image pose a risk:

  • Possible code injection or XSS attacks from Go-based utilities using vulnerable html/template.
  • Improper IP-based access control due to net/netip issues.
  • Heap-based buffer overflow risk from zlib, potentially allowing malicious data processing.

Request for Guidance

  1. Are there updated PostgreSQL images compatible with CNPG that address these vulnerabilities?
  2. If not, what is the recommended approach to mitigate these issues in the current image version?
  3. Should we consider custom-building an image with patched dependencies? If so, are there any best practices for ensuring compatibility with CNPG?

Environment Details

  • CNPG Version: 1.25.0
  • PostgreSQL Image Version: 17.2-28-bookworm

We look forward to the community's insights and recommendations. Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions