Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

discv4 protocol message exception message received a correct reply #30944

Open
1033309821 opened this issue Dec 20, 2024 · 0 comments
Open

discv4 protocol message exception message received a correct reply #30944

1033309821 opened this issue Dec 20, 2024 · 0 comments
Labels

Comments

@1033309821
Copy link

System information

Geth version: last version
OS & Version: Linux

Expected behaviour

We found that discv4 would have abnormal message acceptance behaviors, such as "ping, findnode and ENRRequest" through the devp2p test tool we developed. After the tool and the node established a discv4 band, we continuously sent messages for testing and found that the node would reply with some abnormal messages, such as: expiration < now time, expiration = 0, version != correct value etc... For details, please refer to the json file in our experiment, which records the message information of abnormal message acceptance. The "check" field is defined according to the devp2p protocol specification to determine whether the message sent is abnormal, Success indicates whether the tested node replies, and Request and Response indicate the detailed contents of the sent and received messages respectively.

Actual behaviour

Abnormal network packets should not get a correct reply, they should be discarded, otherwise they will occupy the node's resources, thereby triggering network layer attacks, such as Dos, message replay, etc.

Backtrace


    {
        "PacketID": 0,
        "RequestType": "PING/v4",
        "Check": false,
        "CheckResults": [
            true,
            true,
            true,
            true,
            false
        ],
        "Success": true,
        "Request": {
            "Version": 4,
            "From": {
                "IP": "192.168.1.154",
                "UDP": 49447,
                "TCP": 0
            },
            "To": {
                "IP": "10.130.147.103",
                "UDP": 30306,
                "TCP": 0
            },
            "Expiration": 877065934,
            "ENRSeq": 1734437009546,
            "Rest": [
                ""
            ]
        },
        "Response": {
            "To": {
                "IP": "10.130.159.58",
                "UDP": 49447,
                "TCP": 0
            },
            "ReplyTok": "iCFPz8MN2VMWyW/+zL6pXaKcauEXLEIx7RfJ9Yk3alo=",
            "Expiration": 1734437030,
            "ENRSeq": 1733203734245,
            "Rest": []
        },
        "Error": null
    },
    {
        "PacketID": 1,
        "RequestType": "PING/v4",
        "Check": false,
        "CheckResults": [
            false,
            true,
            true,
            true,
            false
        ],
        "Success": true,
        "Request": {
            "Version": 186211441,
            "From": {
                "IP": "192.168.1.154",
                "UDP": 49447,
                "TCP": 0
            },
            "To": {
                "IP": "10.130.147.103",
                "UDP": 30306,
                "TCP": 0
            },
            "Expiration": 877065934,
            "ENRSeq": 1734437009546,
            "Rest": [
                ""
            ]
        },
        "Response": {
            "To": {
                "IP": "10.130.159.58",
                "UDP": 49447,
                "TCP": 0
            },
            "ReplyTok": "POPk9+1nch7uw5/F74ha/nVVNnhFfu/XmpFrgQ73vfw=",
            "Expiration": 1734437030,
            "ENRSeq": 1733203734245,
            "Rest": []
        },
        "Error": null
    },
    {
        "PacketID": 2,
        "RequestType": "PING/v4",
        "Check": false,
        "CheckResults": [
            false,
            true,
            true,
            true,
            true
        ],
        "Success": true,
        "Request": {
            "Version": 21804873,
            "From": {
                "IP": "192.168.1.154",
                "UDP": 49447,
                "TCP": 0
            },
            "To": {
                "IP": "10.130.147.103",
                "UDP": 30306,
                "TCP": 0
            },
            "Expiration": 7016527472,
            "ENRSeq": 1734437009546,
            "Rest": [
                ""
            ]
        },
        "Response": {
            "To": {
                "IP": "10.130.159.58",
                "UDP": 49447,
                "TCP": 0
            },
            "ReplyTok": "POPk9+1nch7uw5/F74ha/nVVNnhFfu/XmpFrgQ73vfw=",
            "Expiration": 1734437030,
            "ENRSeq": 1733203734245,
            "Rest": []
        },
        "Error": null
    },
    {
        "PacketID": 3,
        "RequestType": "PING/v4",
        "Check": false,
        "CheckResults": [
            false,
            true,
            true,
            true,
            true
        ],
        "Success": true,
        "Request": {
            "Version": 21804873,
            "From": {
                "IP": "192.168.1.154",
                "UDP": 49447,
                "TCP": 0
            },
            "To": {
                "IP": "10.130.147.103",
                "UDP": 30306,
                "TCP": 0
            },
            "Expiration": 18446744066693024143,
            "ENRSeq": 1734437009546,
            "Rest": [
                ""
            ]
        },
        "Response": {
            "To": {
                "IP": "10.130.159.58",
                "UDP": 49447,
                "TCP": 0
            },
            "ReplyTok": "N/8QGYRqtESAR26/B1NoMiOmGSVSc+TGUCRKbh5DRMA=",
            "Expiration": 1734437030,
            "ENRSeq": 1733203734245,
            "Rest": []
        },
        "Error": null
    },
    {
        "PacketID": 4,
        "RequestType": "PING/v4",
        "Check": false,
        "CheckResults": [
            false,
            true,
            true,
            true,
            true
        ],
        "Success": true,
        "Request": {
            "Version": 21804873,
            "From": {
                "IP": "192.168.1.154",
                "UDP": 49447,
                "TCP": 0
            },
            "To": {
                "IP": "10.130.147.103",
                "UDP": 30306,
                "TCP": 0
            },
            "Expiration": 17496508937953900866,
            "ENRSeq": 1734437009546,
            "Rest": [
                ""
            ]
        },
        "Response": {
            "To": {
                "IP": "10.130.159.58",
                "UDP": 49447,
                "TCP": 0
            },
            "ReplyTok": "N/8QGYRqtESAR26/B1NoMiOmGSVSc+TGUCRKbh5DRMA=",
            "Expiration": 1734437030,
            "ENRSeq": 1733203734245,
            "Rest": []
        },
        "Error": null
    },
    {
        "PacketID": 5,
        "RequestType": "PING/v4",
        "Check": false,
        "CheckResults": [
            false,
            true,
            true,
            true,
            false
        ],
        "Success": true,
        "Request": {
            "Version": 21804873,
            "From": {
                "IP": "192.168.1.154",
                "UDP": 49447,
                "TCP": 0
            },
            "To": {
                "IP": "10.130.147.103",
                "UDP": 30306,
                "TCP": 0
            },
            "Expiration": 0,
            "ENRSeq": 1734437009546,
            "Rest": [
                ""
            ]
        },
        "Response": {
            "To": {
                "IP": "10.130.159.58",
                "UDP": 49447,
                "TCP": 0
            },
            "ReplyTok": "N/8QGYRqtESAR26/B1NoMiOmGSVSc+TGUCRKbh5DRMA=",
            "Expiration": 1734437030,
            "ENRSeq": 1733203734245,
            "Rest": []
        },
        "Error": null
    },
    {
        "PacketID": 6,
        "RequestType": "PING/v4",
        "Check": false,
        "CheckResults": [
            false,
            true,
            true,
            false,
            false
        ],
        "Success": true,
        "Request": {
            "Version": 21804873,
            "From": {
                "IP": "192.168.1.154",
                "UDP": 49447,
                "TCP": 0
            },
            "To": {
                "IP": "10.130.147.103",
                "UDP": 30306,
                "TCP": 0
            },
            "Expiration": 358,
            "ENRSeq": 3719048374,
            "Rest": [
                ""
            ]
        },
        "Response": {
            "To": {
                "IP": "10.130.159.58",
                "UDP": 49447,
                "TCP": 0
            },
            "ReplyTok": "0i3pJPJnZYqCCHbbKA4Xw4x7GL7PaRrMiqjszuMSN34=",
            "Expiration": 1734437030,
            "ENRSeq": 1733203734245,
            "Rest": []
        },
        "Error": null
    },
    {
        "PacketID": 7,
        "RequestType": "PING/v4",
        "Check": false,
        "CheckResults": [
            false,
            true,
            true,
            false,
            false
        ],
        "Success": true,
        "Request": {
            "Version": 3916889645,
            "From": {
                "IP": "192.168.1.154",
                "UDP": 49447,
                "TCP": 0
            },
            "To": {
                "IP": "10.130.147.103",
                "UDP": 30306,
                "TCP": 0
            },
            "Expiration": 244,
            "ENRSeq": 1427936328,
            "Rest": [
                ""
            ]
        },
        "Response": {
            "To": {
                "IP": "10.130.159.58",
                "UDP": 49447,
                "TCP": 0
            },
            "ReplyTok": "yqtSgredwXJ/ucy1gmZFrhraPlcHvotYvDTDbe0IGWA=",
            "Expiration": 1734437030,
            "ENRSeq": 1733203734245,
            "Rest": []
        },
        "Error": null
    },
    {
        "PacketID": 8,
        "RequestType": "PING/v4",
        "Check": false,
        "CheckResults": [
            false,
            true,
            true,
            false,
            true
        ],
        "Success": true,
        "Request": {
            "Version": 3916889645,
            "From": {
                "IP": "192.168.1.154",
                "UDP": 49447,
                "TCP": 0
            },
            "To": {
                "IP": "10.130.147.103",
                "UDP": 30306,
                "TCP": 0
            },
            "Expiration": 18446744073709551615,
            "ENRSeq": 1427936328,
            "Rest": [
                ""
            ]
        },
        "Response": {
            "To": {
                "IP": "10.130.159.58",
                "UDP": 49447,
                "TCP": 0
            },
            "ReplyTok": "yqtSgredwXJ/ucy1gmZFrhraPlcHvotYvDTDbe0IGWA=",
            "Expiration": 1734437030,
            "ENRSeq": 1733203734245,
            "Rest": []
        },
        "Error": null
    },
    {
        "PacketID": 9,
        "RequestType": "PING/v4",
        "Check": false,
        "CheckResults": [
            false,
            true,
            true,
            false,
            true
        ],
        "Success": true,
        "Request": {
            "Version": 3916889645,
            "From": {
                "IP": "192.168.1.154",
                "UDP": 49447,
                "TCP": 0
            },
            "To": {
                "IP": "10.130.147.103",
                "UDP": 30306,
                "TCP": 0
            },
            "Expiration": 14227682649620655887,
            "ENRSeq": 975775951,
            "Rest": [
                ""
            ]
        },
        "Response": {
            "To": {
                "IP": "10.130.159.58",
                "UDP": 49447,
                "TCP": 0
            },
            "ReplyTok": "yqtSgredwXJ/ucy1gmZFrhraPlcHvotYvDTDbe0IGWA=",
            "Expiration": 1734437030,
            "ENRSeq": 1733203734245,
            "Rest": []
        },
        "Error": null
    },
    {
        "PacketID": 13,
        "RequestType": "PING/v4",
        "Check": false,
        "CheckResults": [
            false,
            true,
            true,
            false,
            true
        ],
        "Success": true,
        "Request": {
            "Version": 1351523667,
            "From": {
                "IP": "192.168.1.154",
                "UDP": 49447,
                "TCP": 0
            },
            "To": {
                "IP": "10.130.147.103",
                "UDP": 30306,
                "TCP": 0
            },
            "Expiration": 10133271797287065889,
            "ENRSeq": 3486813062,
            "Rest": [
                ""
            ]
        },
        "Response": {
            "To": {
                "IP": "10.130.159.58",
                "UDP": 49447,
                "TCP": 0
            },
            "ReplyTok": "4vFh3ilZcUttMv6dvKUxvE2TJzXH3zrDfymwGWSP3MQ=",
            "Expiration": 1734437030,
            "ENRSeq": 1733203734245,
            "Rest": []
        },
        "Error": null
    },
    {
        "PacketID": 15,
        "RequestType": "PING/v4",
        "Check": false,
        "CheckResults": [
            false,
            true,
            true,
            false,
            false
        ],
        "Success": true,
        "Request": {
            "Version": 1351523667,
            "From": {
                "IP": "192.168.1.154",
                "UDP": 49447,
                "TCP": 0
            },
            "To": {
                "IP": "10.130.147.103",
                "UDP": 30306,
                "TCP": 0
            },
            "Expiration": 0,
            "ENRSeq": 3462591921,
            "Rest": [
                ""
            ]
        },
        "Response": {
            "To": {
                "IP": "10.130.159.58",
                "UDP": 49447,
                "TCP": 0
            },
            "ReplyTok": "OaYk5aZ7neIj/c1FH5BYHzoqmuF/IA8fLxXizD1Fv34=",
            "Expiration": 1734437030,
            "ENRSeq": 1733203734245,
            "Rest": []
        },
        "Error": null
    }
]

When submitting logs: please submit them as text and not screenshots.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant