Skip to content

[Bug]: x509_v2 mishandles some GeneralNames #70041

Closed

Description

@lkubb

What happened?

There are some valid GeneralName values that are not accepted by salt.utils.x509._parse_general_names and invalid ones that are. It also does not differentiate properly between regular GeneralNames and the ones used in the nameConstraints extension. Most of them affect the URI type. Some shoutouts:

  1. nameConstraints URI: Must be in the same format as DNS, but .foo.bar is not accepted and https://foo.bar is.
  2. URI: We automatically encode unicode in the hostname portion according to IDNA. We should automatically encode other segments according to IRI.
  3. URI: IPv6 addresses as hostname result in an exception.
  4. URI: One without an authority (like mailto:[email protected]) is silently dropped.
  5. URI: Regular ones require a scheme, but we don't.
  6. URI: The hostname can be an explicit absolute root (foo.bar.), which is rejected.
  7. email: We IDNA-encode the domain, but we don't check for unicode in the local (user) part, which is invalid. Unicode email addresses should be put into an otherName of SmtpUTF8Mailbox type.
  8. IP: A regular IPAddress must contain a single address, but we additionally accept network ranges.
  9. nameConstraints IP: IPAddress must contain a network range, but we additionally accept IP addresses.
  10. DNS: While not following more modern TLS specs, foo*.bar.baz and foo.*.bar used to be valid wildcard definitions and could still be used by other specs. They result in an exception currently.

Type of salt install

Official deb

Major version

3006.x, 3007.x, 3008.x

What supported OS are you seeing the problem on? Can select multiple. (If bug appears on an unsupported OS, please open a GitHub Discussion instead)

ubuntu-24.04

salt --versions-report output

Latest HEAD of 3006.x

Activity

  1. added
    bug
    on Aug 14, 2026
  2. dwoz commented on Oct 16, 2026

    @dwoz
    Contributor

    This was fixed in v3006.28 and v3007.15. If you can still reproduce it on either release, please comment and we'll reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugneeds-triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions