GHSA-C839-4QXR-J4X3

Vulnerability from github – Published: 2026-05-04 19:08 – Updated: 2026-05-08 19:26
VLAI?
Summary
Incus has an OVN TLS Verification that Accepts Peer-Supplied Roots
Details

Summary

Broken TLS validation logic in the OVN database connection logic could allow connections to an attacker's OVN database.

OVN uses mTLS for authentication, so the attacker cannot actually perform a full man in the middle attack as they won't be able to authenticated with the real OVN deployment. At best they can provide a replacement empty database which Incus will briefly interact with before hitting errors due to the rest of the OVN stack not reacting to the committed changes.

Also worth noting that the OVN control plane is typically run on the same servers that run Incus, there is typically no routing involved between an Incus server and the OVN control plane, making such an attack extremely difficult to pull off in the first place.

Details

The OVN client implementations within Incus disable Go standard TLS server verification (InsecureSkipVerify: true) and replace it with custom peer-certificate verification logic. That replacement verifier does not anchor trust in the configured CA certificate. Instead, it constructs the verification root set from certificates supplied by the peer during the handshake. As a result, the configured CA is parsed but not used as the trust anchor for the final verification decision.

Although a configured CA certificate (tlsCAcert) is parsed and added to a client CA pool, that pool is not used during the final verification decision. Instead, the callback creates a fresh roots pool from the raw certificates received over the wire and verifies the presented leaf certificate against those attacker-influenced roots. No endpoint identity validation is visible in the provided verification logic.

In OVN-enabled Incus deployments that use these SSL database connection paths, this affects authenticated connections from Incus to the OVN northbound and southbound databases. Incus documents clustered OVN deployments in which the OVN distributed database runs across multiple servers, and upstream OVN documentation describes the northbound database as the interface used by the cloud management system and the southbound database as the central coordination point for logical and physical network state.

Because the custom verifier accepts peer-supplied trust anchors, an attacker able to impersonate or intercept the OVN endpoint on the management network can present a rogue self-signed certificate chain. Incus will accept this certificate as valid, collapsing the configured CA-based trust model. Because Incus exposes dedicated OVN TLS settings for a CA certificate, client certificate, and client key, the implementation clearly intends to authenticate OVN database connections using operator-supplied trust material rather than peer-supplied certificates. By abandoning the configured CA pool and instead trusting peer-supplied roots, the implementation defeats the intended authentication boundary on OVN database connections and permits endpoint impersonation by an active attacker able to intercept or stand in for the OVN database service.

In clustered OVN-backed Incus deployments, this flaw reduces CA-anchored authentication of OVN database connections to endpoint impersonation for an attacker with a suitable position on the management or control-plane network. This is especially significant because OVN northbound and southbound databases are the authoritative control-plane interfaces for logical network configuration, translation, and distribution to hypervisors and gateways. As a result, the issue is best understood as a control-plane authentication failure with potentially broad networking impact, not merely as generic TLS misconfiguration.

Affected Files: https://github.com/lxc/incus/blob/v6.22.0/internal/server/network/ovn/ovn_nb.go https://github.com/lxc/incus/blob/v6.22.0/internal/server/network/ovn/ovn_sb.go https://github.com/lxc/incus/blob/v6.22.0/internal/server/network/ovn/ovn_icnb.go https://github.com/lxc/incus/blob/v6.22.0/internal/server/network/ovn/ovn_icsb.go

Affected Code:

func NewNB(dbAddr string, sslCACert string, sslClientCert string, sslClientKey string) (*NB, error) {
    [...]
    if strings.Contains(dbAddr, "ssl:") {
        [...]
        tlsConfig := &tls.Config{
            Certificates:       []tls.Certificate{clientCert},
            InsecureSkipVerify: true,
        }

        if sslCACert != "" {
            [...]
            tlsCAcert, err := x509.ParseCertificate(tlsCAder.Bytes)
            if err != nil {
                return nil, err
            }

            tlsCAcert.IsCA = true
            tlsCAcert.KeyUsage = x509.KeyUsageCertSign

            clientCAPool := x509.NewCertPool()
            clientCAPool.AddCert(tlsCAcert)

            tlsConfig.VerifyPeerCertificate = func(rawCerts [][]byte, chains [][]*x509.Certificate) error {
                if len(rawCerts) < 1 {
                    return errors.New("Missing server certificate")
                }

                roots := x509.NewCertPool()
                for _, rawCert := range rawCerts {
                    cert, _ := x509.ParseCertificate(rawCert)
                    if cert != nil {
                        roots.AddCert(cert)
                    }
                }

                cert, _ := x509.ParseCertificate(rawCerts[0])
                if cert == nil {
                    return errors.New("Bad server certificate")
                }

                opts := x509.VerifyOptions{
                    Roots: roots,
                }

                _, err := cert.Verify(opts)
                return err
            }
        }

        options = append(options, ovsdbClient.WithTLSConfig(tlsConfig))
    }
    [...]
}

The same verification pattern is duplicated in the other affected files listed above.

Verification-Logic Proof of Concept

Because the vulnerability resides entirely in the certificate-verification logic, it can be demonstrated in isolation without a live interception lab. The following Go harness reproduces the effective OVN client verification logic, generates a rogue self-signed certificate, and demonstrates that the implemented trust decision accepts peer-supplied roots instead of the configured CA pool.

Commands:

cat <<'EOF' > poc_ovn_tls_roots.go
package main

import (
    "crypto/ed25519"
    "crypto/rand"
    "crypto/x509"
    "crypto/x509/pkix"
    "fmt"
    "math/big"
    "time"
)

func main() {
    pub, priv, _ := ed25519.GenerateKey(rand.Reader)

    template := x509.Certificate{
        SerialNumber: big.NewInt(1),
        Subject: pkix.Name{
            Organization: []string{"Attacker Corp MITM"},
        },
        NotBefore:             time.Now(),
        NotAfter:              time.Now().Add(time.Hour),
        KeyUsage:              x509.KeyUsageDigitalSignature | x509.KeyUsageCertSign,
        ExtKeyUsage:           []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth},
        BasicConstraintsValid: true,
        IsCA:                  true,
    }

    rogueCertBytes, _ := x509.CreateCertificate(rand.Reader, &template, &template, pub, priv)

    verifyPeerCertificate := func(rawCerts [][]byte) error {
        if len(rawCerts) < 1 {
            return fmt.Errorf("missing server certificate")
        }

        roots := x509.NewCertPool()
        for _, rawCert := range rawCerts {
            cert, _ := x509.ParseCertificate(rawCert)
            if cert != nil {
                roots.AddCert(cert)
            }
        }

        cert, _ := x509.ParseCertificate(rawCerts[0])
        if cert == nil {
            return fmt.Errorf("bad server certificate")
        }

        opts := x509.VerifyOptions{
            Roots: roots,
        }

        _, err := cert.Verify(opts)
        return err
    }

    err := verifyPeerCertificate([][]byte{rogueCertBytes})
    if err == nil {
        fmt.Println("[!] VULNERABLE: The reproduced OVN client verification logic accepted the rogue attacker certificate.")
    } else {
        fmt.Printf("Safe: Rejected with error: %v\n", err)
    }
}
EOF

go run poc_ovn_tls_roots.go

Result:

[!] VULNERABLE: The reproduced OVN client verification logic accepted the rogue attacker certificate.

It is recommended to verify peer certificates against the configured CA pool rather than against roots synthesized from untrusted peer input. The safest fix is to remove the custom VerifyPeerCertificate logic and rely on Go standard TLS verification with tls.Config.RootCAs set to the configured CA pool and, where applicable, ServerName set appropriately for identity validation.

Credit

This issue was discovered and reported by the team at 7asecurity (https://7asecurity.com/)

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "Go",
        "name": "github.com/lxc/incus/v6/cmd/incusd"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "7.0.0"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2026-40243"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-287",
      "CWE-295"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-05-04T19:08:01Z",
    "nvd_published_at": "2026-05-06T21:16:01Z",
    "severity": "LOW"
  },
  "details": "### Summary\nBroken TLS validation logic in the OVN database connection logic could allow connections to an attacker\u0027s OVN database.\n\nOVN uses mTLS for authentication, so the attacker cannot actually perform a full man in the middle attack as they won\u0027t be able to authenticated with the real OVN deployment. At best they can provide a replacement empty database which Incus will briefly interact with before hitting errors due to the rest of the OVN stack not reacting to the committed changes.\n\nAlso worth noting that the OVN control plane is typically run on the same servers that run Incus, there is typically no routing involved between an Incus server and the OVN control plane, making such an attack extremely difficult to pull off in the first place.\n\n### Details\nThe OVN client implementations within Incus disable Go standard TLS server verification (InsecureSkipVerify: true) and replace it with custom peer-certificate verification logic. That replacement verifier does not anchor trust in the configured CA certificate. Instead, it constructs the verification root set from certificates supplied by the peer during the handshake. As a result, the configured CA is parsed but not used as the trust anchor for the final verification decision.\n\nAlthough a configured CA certificate (tlsCAcert) is parsed and added to a client CA pool, that pool is not used during the final verification decision. Instead, the callback creates a fresh roots pool from the raw certificates received over the wire and verifies the presented leaf certificate against those attacker-influenced roots. No endpoint identity validation is visible in the provided verification logic.\n\nIn OVN-enabled Incus deployments that use these SSL database connection paths, this affects authenticated connections from Incus to the OVN northbound and southbound databases. Incus documents clustered OVN deployments in which the OVN distributed database runs across multiple servers, and upstream OVN documentation describes the northbound database as the interface used by the cloud management system and the southbound database as the central coordination point for logical and physical network state.\n\nBecause the custom verifier accepts peer-supplied trust anchors, an attacker able to impersonate or intercept the OVN endpoint on the management network can present a rogue self-signed certificate chain. Incus will accept this certificate as valid, collapsing the configured CA-based trust model. Because Incus exposes dedicated OVN TLS settings for a CA certificate, client certificate, and client key, the implementation clearly intends to authenticate OVN database connections using operator-supplied trust material rather than peer-supplied certificates. By abandoning the configured CA pool and instead trusting peer-supplied roots, the implementation defeats the intended authentication boundary on OVN database connections and permits endpoint impersonation by an active attacker able to intercept or stand in for the OVN database service.\n\nIn clustered OVN-backed Incus deployments, this flaw reduces CA-anchored authentication of OVN database connections to endpoint impersonation for an attacker with a suitable position on the management or control-plane network. This is especially significant because OVN northbound and southbound databases are the authoritative control-plane interfaces for logical network configuration, translation, and distribution to hypervisors and gateways. As a result, the issue is best understood as a control-plane authentication failure with potentially broad networking impact, not merely as generic TLS misconfiguration.\n\nAffected Files:\nhttps://github.com/lxc/incus/blob/v6.22.0/internal/server/network/ovn/ovn_nb.go \nhttps://github.com/lxc/incus/blob/v6.22.0/internal/server/network/ovn/ovn_sb.go \nhttps://github.com/lxc/incus/blob/v6.22.0/internal/server/network/ovn/ovn_icnb.go \nhttps://github.com/lxc/incus/blob/v6.22.0/internal/server/network/ovn/ovn_icsb.go \n\nAffected Code:\n```\nfunc NewNB(dbAddr string, sslCACert string, sslClientCert string, sslClientKey string) (*NB, error) {\n    [...]\n    if strings.Contains(dbAddr, \"ssl:\") {\n        [...]\n        tlsConfig := \u0026tls.Config{\n            Certificates:       []tls.Certificate{clientCert},\n            InsecureSkipVerify: true,\n        }\n\n        if sslCACert != \"\" {\n            [...]\n            tlsCAcert, err := x509.ParseCertificate(tlsCAder.Bytes)\n            if err != nil {\n                return nil, err\n            }\n\n            tlsCAcert.IsCA = true\n            tlsCAcert.KeyUsage = x509.KeyUsageCertSign\n\n            clientCAPool := x509.NewCertPool()\n            clientCAPool.AddCert(tlsCAcert)\n\n            tlsConfig.VerifyPeerCertificate = func(rawCerts [][]byte, chains [][]*x509.Certificate) error {\n                if len(rawCerts) \u003c 1 {\n                    return errors.New(\"Missing server certificate\")\n                }\n\n                roots := x509.NewCertPool()\n                for _, rawCert := range rawCerts {\n                    cert, _ := x509.ParseCertificate(rawCert)\n                    if cert != nil {\n                        roots.AddCert(cert)\n                    }\n                }\n\n                cert, _ := x509.ParseCertificate(rawCerts[0])\n                if cert == nil {\n                    return errors.New(\"Bad server certificate\")\n                }\n\n                opts := x509.VerifyOptions{\n                    Roots: roots,\n                }\n\n                _, err := cert.Verify(opts)\n                return err\n            }\n        }\n\n        options = append(options, ovsdbClient.WithTLSConfig(tlsConfig))\n    }\n    [...]\n}\n```\n\nThe same verification pattern is duplicated in the other affected files listed above.\n\nVerification-Logic Proof of Concept\n\nBecause the vulnerability resides entirely in the certificate-verification logic, it can be demonstrated in isolation without a live interception lab. The following Go harness reproduces the effective OVN client verification logic, generates a rogue self-signed certificate, and demonstrates that the implemented trust decision accepts peer-supplied roots instead of the configured CA pool.\n\nCommands:\n```\ncat \u003c\u003c\u0027EOF\u0027 \u003e poc_ovn_tls_roots.go\npackage main\n\nimport (\n    \"crypto/ed25519\"\n    \"crypto/rand\"\n    \"crypto/x509\"\n    \"crypto/x509/pkix\"\n    \"fmt\"\n    \"math/big\"\n    \"time\"\n)\n\nfunc main() {\n    pub, priv, _ := ed25519.GenerateKey(rand.Reader)\n\n    template := x509.Certificate{\n        SerialNumber: big.NewInt(1),\n        Subject: pkix.Name{\n            Organization: []string{\"Attacker Corp MITM\"},\n        },\n        NotBefore:             time.Now(),\n        NotAfter:              time.Now().Add(time.Hour),\n        KeyUsage:              x509.KeyUsageDigitalSignature | x509.KeyUsageCertSign,\n        ExtKeyUsage:           []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth},\n        BasicConstraintsValid: true,\n        IsCA:                  true,\n    }\n\n    rogueCertBytes, _ := x509.CreateCertificate(rand.Reader, \u0026template, \u0026template, pub, priv)\n\n    verifyPeerCertificate := func(rawCerts [][]byte) error {\n        if len(rawCerts) \u003c 1 {\n            return fmt.Errorf(\"missing server certificate\")\n        }\n\n        roots := x509.NewCertPool()\n        for _, rawCert := range rawCerts {\n            cert, _ := x509.ParseCertificate(rawCert)\n            if cert != nil {\n                roots.AddCert(cert)\n            }\n        }\n\n        cert, _ := x509.ParseCertificate(rawCerts[0])\n        if cert == nil {\n            return fmt.Errorf(\"bad server certificate\")\n        }\n\n        opts := x509.VerifyOptions{\n            Roots: roots,\n        }\n\n        _, err := cert.Verify(opts)\n        return err\n    }\n\n    err := verifyPeerCertificate([][]byte{rogueCertBytes})\n    if err == nil {\n        fmt.Println(\"[!] VULNERABLE: The reproduced OVN client verification logic accepted the rogue attacker certificate.\")\n    } else {\n        fmt.Printf(\"Safe: Rejected with error: %v\\n\", err)\n    }\n}\nEOF\n\ngo run poc_ovn_tls_roots.go\n```\n\nResult:\n```\n[!] VULNERABLE: The reproduced OVN client verification logic accepted the rogue attacker certificate.\n```\n\nIt is recommended to verify peer certificates against the configured CA pool rather than against roots synthesized from untrusted peer input. The safest fix is to remove the custom VerifyPeerCertificate logic and rely on Go standard TLS verification with tls.Config.RootCAs set to the configured CA pool and, where applicable, ServerName set appropriately for identity validation.\n\n### Credit\nThis issue was discovered and reported by the team at 7asecurity (https://7asecurity.com/)",
  "id": "GHSA-c839-4qxr-j4x3",
  "modified": "2026-05-08T19:26:41Z",
  "published": "2026-05-04T19:08:01Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/lxc/incus/security/advisories/GHSA-c839-4qxr-j4x3"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-40243"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/lxc/incus"
    },
    {
      "type": "WEB",
      "url": "https://github.com/lxc/incus/blob/v6.22.0/internal/server/network/ovn/ovn_icnb.go"
    },
    {
      "type": "WEB",
      "url": "https://github.com/lxc/incus/blob/v6.22.0/internal/server/network/ovn/ovn_icsb.go"
    },
    {
      "type": "WEB",
      "url": "https://github.com/lxc/incus/blob/v6.22.0/internal/server/network/ovn/ovn_nb.go"
    },
    {
      "type": "WEB",
      "url": "https://github.com/lxc/incus/blob/v6.22.0/internal/server/network/ovn/ovn_sb.go"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:L/I:N/A:N",
      "type": "CVSS_V3"
    },
    {
      "score": "CVSS:4.0/AV:A/AC:H/AT:N/PR:N/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N",
      "type": "CVSS_V4"
    }
  ],
  "summary": "Incus has an OVN TLS Verification that Accepts Peer-Supplied Roots"
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…
Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.


Loading…

Detection rules are retrieved from Rulezet.

Loading…

Loading…