Skip to content

Add lint to detect HTML entities in Subject attributes#907

Merged
christopher-henderson merged 35 commits intozmap:masterfrom
defacto64:html_entities
Dec 28, 2024
Merged

Add lint to detect HTML entities in Subject attributes#907
christopher-henderson merged 35 commits intozmap:masterfrom
defacto64:html_entities

Conversation

@defacto64
Copy link
Copy Markdown
Contributor

Due to some strange programming error, sometimes it happens that the value of some Subject attribute ends up containing HTML entities, for example "&" instead of the ampersand character ("&"). This has happened several times, mostly in the past but also recently (see Bugzilla). This lint looks for HTML entities in Subject attributes that might contain them, and raises an error if it finds any.

Since a false positive cannot be completely ruled out (in some jurisdictions it may be allowed to register a company with a name that would trigger this lint), it is possible to bypass this lint through configuration. To do so, pass the path of a TOML file to zlint (via the -config option) with this content:

[e_subj_contains_html_entities]
Skip = true

defacto64 and others added 30 commits March 8, 2024 16:07
Added //nolint:all to comment block to avoid golangci-lint to complain about duplicate words in comment
Fine to me.

Co-authored-by: Christopher Henderson <[email protected]>
As per Chris Henderson's suggestion, to "improve readability".
As per Chris Henderson's suggestion.
Added CABFEV_Sec9_2_8_Date
Copy link
Copy Markdown
Member

@christopher-henderson christopher-henderson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Thank you for your patience over the holidays.
  2. This is a silly thing that some code somewhere has done.
  3. I was trying to think of something better than a regex, like perhaps HTML decoding the string and seeing if it still matches the original. But that has its own complications too.
  4. I do not find it likely that people have company names with HTML entities in it, so I agree that this is likely fine.
  5. Thank you for using the configuration infrastructure!

{
input: "html_entity_ok3.pem",
config: `
[e_subj_contains_html_entities]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank for exercising this.

@christopher-henderson christopher-henderson merged commit 629cb54 into zmap:master Dec 28, 2024
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 this pull request may close these issues.

2 participants