Skip to content

Bad target domain parsing. #1626

Open
@taoso

Description

Here are some bad RRs with invalid (empty) target (please note the space before the ;)

bad.example.org.        CNAME ; bad cname
bad.example.org.        HTTPS 10 ; bad https
bad.example.org.        MX 10 ; bad mx
bad.example.org.        SRV 1 0 80 ; bad srv

This will be parsed to the following result without error, which treat the empty blank as the \010..

bad.example.org.        CNAME   \010.
bad.example.org.        HTTPS   10 \010.
bad.example.org.        MX      10 \010.
bad.example.org.        SRV     1 0 80 \010. 

However, if we trim the space before the ;

bad.example.org.        CNAME; bad cname
bad.example.org.        HTTPS 10; bad https
bad.example.org.        MX 10; bad mx
bad.example.org.        SRV 1 0 80; bad srv

The parser will trigger the following errors as exptected

dns: not a TTL: "CNAME" at line: 1:23
dns: bad SVCB Target: " " at line: 1:23
dns: bad MX Mx: " " at line: 1:20
dns: bad SRV Target: " " at line: 1:21

I propose to trigger error for any case that contains empty target.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions