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

Bad target domain parsing. #1626

Open
taoso opened this issue Jan 24, 2025 · 0 comments · May be fixed by #1627
Open

Bad target domain parsing. #1626

taoso opened this issue Jan 24, 2025 · 0 comments · May be fixed by #1627

Comments

@taoso
Copy link

taoso commented Jan 24, 2025

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.

@taoso taoso linked a pull request Jan 24, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant