{
    "dataType": "CVE_RECORD",
    "dataVersion": "5.1",
    "cveMetadata": {
        "cveId": "CVE-2022-23495",
        "assignerOrgId": "a0819718-46f1-4df5-94e2-005712e83aaa",
        "state": "PUBLISHED",
        "assignerShortName": "GitHub_M",
        "requesterUserId": "c184a3d9-dc98-4c48-a45b-d2d88cf0ac74",
        "dateReserved": "2022-01-19T21:23:53.766Z",
        "datePublished": "2022-12-08T21:25:40.257Z",
        "dateUpdated": "2024-08-03T03:43:46.142Z"
    },
    "containers": {
        "cna": {
            "title": "ProtoNode may be modified such that common method calls may panic in ipfs/go-merkledag",
            "problemTypes": [
                {
                    "descriptions": [
                        {
                            "cweId": "CWE-755",
                            "lang": "en",
                            "description": "CWE-755: Improper Handling of Exceptional Conditions",
                            "type": "CWE"
                        }
                    ]
                }
            ],
            "metrics": [
                {
                    "cvssV3_1": {
                        "attackComplexity": "LOW",
                        "attackVector": "NETWORK",
                        "availabilityImpact": "HIGH",
                        "baseScore": 7.5,
                        "baseSeverity": "HIGH",
                        "confidentialityImpact": "NONE",
                        "integrityImpact": "NONE",
                        "privilegesRequired": "NONE",
                        "scope": "UNCHANGED",
                        "userInteraction": "NONE",
                        "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H",
                        "version": "3.1"
                    }
                }
            ],
            "references": [
                {
                    "name": "https://github.com/ipfs/go-merkledag/security/advisories/GHSA-x39j-h85h-3f46",
                    "tags": [
                        "x_refsource_CONFIRM"
                    ],
                    "url": "https://github.com/ipfs/go-merkledag/security/advisories/GHSA-x39j-h85h-3f46"
                },
                {
                    "name": "https://github.com/ipfs/go-merkledag/issues/90",
                    "tags": [
                        "x_refsource_MISC"
                    ],
                    "url": "https://github.com/ipfs/go-merkledag/issues/90"
                },
                {
                    "name": "https://github.com/ipfs/kubo/issues/9297",
                    "tags": [
                        "x_refsource_MISC"
                    ],
                    "url": "https://github.com/ipfs/kubo/issues/9297"
                },
                {
                    "name": "https://github.com/ipfs/go-merkledag/pull/91",
                    "tags": [
                        "x_refsource_MISC"
                    ],
                    "url": "https://github.com/ipfs/go-merkledag/pull/91"
                },
                {
                    "name": "https://github.com/ipfs/go-merkledag/pull/92",
                    "tags": [
                        "x_refsource_MISC"
                    ],
                    "url": "https://github.com/ipfs/go-merkledag/pull/92"
                },
                {
                    "name": "https://github.com/ipfs/go-merkledag/pull/93",
                    "tags": [
                        "x_refsource_MISC"
                    ],
                    "url": "https://github.com/ipfs/go-merkledag/pull/93"
                },
                {
                    "name": "https://en.wikipedia.org/wiki/Directed_acyclic_graph",
                    "tags": [
                        "x_refsource_MISC"
                    ],
                    "url": "https://en.wikipedia.org/wiki/Directed_acyclic_graph"
                },
                {
                    "name": "https://github.com/ipfs/go-merkledag/releases/tag/v0.8.0",
                    "tags": [
                        "x_refsource_MISC"
                    ],
                    "url": "https://github.com/ipfs/go-merkledag/releases/tag/v0.8.0"
                },
                {
                    "name": "https://github.com/ipfs/go-merkledag/releases/tag/v0.8.1",
                    "tags": [
                        "x_refsource_MISC"
                    ],
                    "url": "https://github.com/ipfs/go-merkledag/releases/tag/v0.8.1"
                }
            ],
            "affected": [
                {
                    "vendor": "ipfs",
                    "product": "go-merkledag",
                    "versions": [
                        {
                            "version": ">= 0.4.0, < 0.8.1",
                            "status": "affected"
                        }
                    ]
                }
            ],
            "providerMetadata": {
                "orgId": "a0819718-46f1-4df5-94e2-005712e83aaa",
                "shortName": "GitHub_M",
                "dateUpdated": "2022-12-08T21:25:40.257Z"
            },
            "descriptions": [
                {
                    "lang": "en",
                    "value": "go-merkledag implements the 'DAGService' interface and adds two ipld node types, Protobuf and Raw for the ipfs project. A `ProtoNode` may be modified in such a way as to cause various encode errors which will trigger a panic on common method calls that don't allow for error returns. A `ProtoNode` should only be able to encode to valid DAG-PB, attempting to encode invalid DAG-PB forms will result in an error from the codec. Manipulation of an existing (newly created or decoded) `ProtoNode` using the modifier methods did not account for certain states that would place the `ProtoNode` into an unencodeable form. Due to conformance with the [`github.com/ipfs/go-block-format#Block`](https://pkg.go.dev/github.com/ipfs/go-block-format#Block) and [`github.com/ipfs/go-ipld-format#Node`](https://pkg.go.dev/github.com/ipfs/go-ipld-format#Node) interfaces, certain methods, which internally require a re-encode if state has changed, will panic due to the inability to return an error. This issue has been addressed across a number of pull requests. Users are advised to upgrade to version 0.8.1 for a complete set of fixes. Users unable to upgrade may attempt to mitigate this issue by sanitising inputs when allowing user-input to set a new `CidBuilder` on a `ProtoNode` and by sanitising `Tsize` (`Link#Size`) values such that they are a reasonable byte-size for sub-DAGs where derived from user-input.\n"
                }
            ],
            "source": {
                "advisory": "GHSA-x39j-h85h-3f46",
                "discovery": "UNKNOWN"
            }
        },
        "adp": [
            {
                "providerMetadata": {
                    "orgId": "af854a3a-2127-422b-91ae-364da2661108",
                    "shortName": "CVE",
                    "dateUpdated": "2024-08-03T03:43:46.142Z"
                },
                "title": "CVE Program Container",
                "references": [
                    {
                        "name": "https://github.com/ipfs/go-merkledag/security/advisories/GHSA-x39j-h85h-3f46",
                        "tags": [
                            "x_refsource_CONFIRM",
                            "x_transferred"
                        ],
                        "url": "https://github.com/ipfs/go-merkledag/security/advisories/GHSA-x39j-h85h-3f46"
                    },
                    {
                        "name": "https://github.com/ipfs/go-merkledag/issues/90",
                        "tags": [
                            "x_refsource_MISC",
                            "x_transferred"
                        ],
                        "url": "https://github.com/ipfs/go-merkledag/issues/90"
                    },
                    {
                        "name": "https://github.com/ipfs/kubo/issues/9297",
                        "tags": [
                            "x_refsource_MISC",
                            "x_transferred"
                        ],
                        "url": "https://github.com/ipfs/kubo/issues/9297"
                    },
                    {
                        "name": "https://github.com/ipfs/go-merkledag/pull/91",
                        "tags": [
                            "x_refsource_MISC",
                            "x_transferred"
                        ],
                        "url": "https://github.com/ipfs/go-merkledag/pull/91"
                    },
                    {
                        "name": "https://github.com/ipfs/go-merkledag/pull/92",
                        "tags": [
                            "x_refsource_MISC",
                            "x_transferred"
                        ],
                        "url": "https://github.com/ipfs/go-merkledag/pull/92"
                    },
                    {
                        "name": "https://github.com/ipfs/go-merkledag/pull/93",
                        "tags": [
                            "x_refsource_MISC",
                            "x_transferred"
                        ],
                        "url": "https://github.com/ipfs/go-merkledag/pull/93"
                    },
                    {
                        "name": "https://en.wikipedia.org/wiki/Directed_acyclic_graph",
                        "tags": [
                            "x_refsource_MISC",
                            "x_transferred"
                        ],
                        "url": "https://en.wikipedia.org/wiki/Directed_acyclic_graph"
                    },
                    {
                        "name": "https://github.com/ipfs/go-merkledag/releases/tag/v0.8.0",
                        "tags": [
                            "x_refsource_MISC",
                            "x_transferred"
                        ],
                        "url": "https://github.com/ipfs/go-merkledag/releases/tag/v0.8.0"
                    },
                    {
                        "name": "https://github.com/ipfs/go-merkledag/releases/tag/v0.8.1",
                        "tags": [
                            "x_refsource_MISC",
                            "x_transferred"
                        ],
                        "url": "https://github.com/ipfs/go-merkledag/releases/tag/v0.8.1"
                    }
                ]
            }
        ]
    }
}