Skip to content

New Rule: no-null-character #405

Closed as not planned
Closed as not planned
@lumirlumir

Description

@lumirlumir

Rule details

Disallow the null character (U+0000) in Markdown documents.

What type of rule is this?

Warns about a potential problem

Example code

<!-- NULL (U+0000) Character -->

Prior Art

Nothing.

Participation

  • I am willing to submit a pull request to implement this rule.

Additional comments

Hello,

In this PR, I would like to suggest no-null-character.

According to the CommonMark specification (Section 2.3), the Unicode NULL character (U+0000) must be replaced with the Replacement Character (U+FFFD) for security reasons.

Image

The NULL character can cause issues such as early string termination in many programming languages, leading to truncated output or unexpected behavior. It also poses security risks like input validation bypass, XSS, and injection attacks. Additionally, many parsers and rendering engines do not handle U+0000 properly, which can cause crashes or rendering problems.

Adding an ESLint rule to detect and disallow U+0000 helps prevent these risks, ensures compliance with Markdown and web standards, and improves code safety and reliability.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Complete

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions