Clarification: 1.2.9 "typically using a backslash"
Open
Nobody has claimed this yet.
1) Discussion ongoing
3) awaiting proposal
V1 (prev V5)
- Dominant language
- HTML
- Stars
- 3.6k
- Forks
- 831
- Avg merge
- 7h 55m
- Merged PRs (30d)
- 4
Description
1.2.9 Verify that the application escapes special characters in regular expressions (typically using a backslash) to prevent them from being misinterpreted as metacharacters.
- The phrase “typically using a backslash” is oversimplified. While backslash escaping is common in some regex engines, it’s not universal,different regex engines (like PCRE, Java, Python JavaScript) handle metacharacters differently. Manually escaping with backslashes is risky, error-prone, and can lead to vulnerabilities.
- Instead of saying “typically using a backslash”, it’s better to recommend built-in, language-safe escaping functions like re.escape, Regex.Escape, etc., because they handle escaping correctly for that specific language and engine.
- Escaping should not be the default solution in every case. In some situations, strict allowlist validation and input size limits are better than trying to escape everything into a regex.
- The requirement misses an important point,dynamic regex construction should be avoided unless it’s absolutely necessary.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Review the raw Markdown source for ASVS 5.0 requirement 1.2.9, linked from the issue, rather than the derived formats. Compare the current wording with the concerns about language-specific escaping, allowlists, input limits, and dynamic regex construction; done means the requirement accurately reflects the agreed security guidance.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, javascript, python
- Domain
- documentation, security
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100