Skip to content

docs: restore eight markdown links mangled into NUL bytes - #15756

Open
devGregA wants to merge 2 commits into
DefectDojo:devfrom
devGregA:docs_toolreference_nul_bytes
Open

docs: restore eight markdown links mangled into NUL bytes#15756
devGregA wants to merge 2 commits into
DefectDojo:devfrom
devGregA:docs_toolreference_nul_bytes

Conversation

@devGregA

@devGregA devGregA commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Description

Five documentation files contained literal NUL bytes (0x00) that broke eight inline markdown links. In every case a placeholder of the form \0<index>\0 sits exactly where the link destination ](url) belongs, so the link renders as raw text:

File NULs Broken links
connectors/upstream/toolreference.md 6 Semgrep token page, Snyk REST base, Snyk EU REST base
get_started/about/about_defectdojo.md 4 Open-Source demo, Pro demo
get_started/contributing/how-to-write-a-parser.md 2 acunetix.md example page
get_started/contributing/documentation.md 2 http://localhost:1313
issue_tracking/pro_integration/messaging_connectors.md 2 https://api.slack.com/apps

The NUL bytes had a second effect beyond the eight broken links, and it is the reason this went unnoticed: grep reports each of these files as Binary file ... matches and suppresses the matching lines, so the broken text never shows up in a search. For example, grep -rn "Snyk REST API" returned only Binary file ... matches rather than the line. git diff is affected for three of the five — it renders them as Binary files differ — while toolreference.md and how-to-write-a-parser.md still diff as text because their first NUL byte falls past git's 8000-byte binary-detection window.

Origin and how the destinations were recovered

All eight placeholders trace to a single commit, 1cafb09 (#15661). The pattern is consistent with a link-protecting pass that swaps each destination for a NUL-delimited sentinel, rewrites the surrounding prose, and restores the destinations afterwards — with the restore step dropping these eight. Indices are per-file counters (17, 18, 19, 22, 77, 389, 394, 395).

Nothing here is guessed. For each file, the last revision before #15661 still holds the intact text; it was located by walking that file's history and counting NUL bytes per revision until one came back clean. Every repaired line is byte-identical to its pre-#15661 counterpart, and all eight restored links turn out to be self-links (display text equals destination), which is a useful independent sanity check.

toolreference.md has a second corroborating source: its four translated siblings (.de, .es, .fr, .ja) were never touched by #15661 and carry the same markup. They agree with the parent revision on all three destinations. Those four files need no change — 0 NUL bytes each, links intact.

Scope note

One pre-existing inconsistency was deliberately left alone, because it predates the corruption and appears identically in all five language files: the Snyk link text reads /rest while the destination points at /v1. The /rest value is the one the docs instruct you to enter in the Location field, so only the decorative href is stale. Worth a follow-up, but changing it here would mean an unexplained edit sitting on top of an otherwise byte-exact restore.

Test results

  • python -c "d=open('docs/content/connectors/upstream/toolreference.md','rb').read(); print(d.count(b'\0'))"0
  • Repo-wide scan: 0 text files under docs/ contain NUL bytes (images excluded).
  • Regex sweep across all of docs/content for markdown link openers whose next two characters are not ](0 hits, so the defect is fully enumerated rather than partially patched.
  • Every repaired line verified byte-identical to its pre-change all docs references from Products to Assets #15661 revision.
  • No CR bytes introduced; files stay LF-only per .gitattributes (*.md text eol=lf).
  • grep now reads all five files as text.
  • Docs rendering is covered by the existing validate_docs_build workflow; no local Hugo toolchain was used.

Documentation

This PR is the documentation change.

`docs/content/connectors/upstream/toolreference.md` carried six literal NUL
bytes (0x00) that broke three inline markdown links. Each one is a leftover
placeholder of the form `\0<index>\0` sitting where the link destination
`](url)` belongs:

- Semgrep token page: `[https://semgrep.dev/orgs/\-/settings/tokens\0389\0)`
- Snyk REST base:     `**[https://api.snyk.io/rest\0394\0**`
- Snyk EU REST base:  `**[https://api.eu.snyk.io/rest\0395\0**`

The NUL bytes also made the whole file register as binary, so `grep` skipped
it and `git diff` rendered it as "Binary files differ".

The placeholders were introduced in 1cafb09 (DefectDojo#15661); its parent
1e48e93 still has the intact text, and all four translated siblings
(`.de`, `.es`, `.fr`, `.ja`) carry the same markup unchanged. Both sources
agree, so the destinations are restored verbatim from them - the two repaired
lines are now byte-identical to their pre-DefectDojo#15661 counterparts.

The file contains no NUL bytes after this change.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Same defect as the previous commit, same origin (1cafb09 / DefectDojo#15661): a
placeholder of the form \0<index>\0 left sitting where a link destination
`](url)` belongs. A repo-wide scan found four more affected files carrying
ten NUL bytes between them:

- get_started/about/about_defectdojo.md          (2: demo, pro demo)
- get_started/contributing/documentation.md      (1: http://localhost:1313)
- get_started/contributing/how-to-write-a-parser.md (1: acunetix.md example)
- issue_tracking/pro_integration/messaging_connectors.md (1: api.slack.com/apps)

Each destination is restored verbatim from the last revision of that file
before DefectDojo#15661, located by walking the file history and counting NUL bytes per
revision. All five are self-links (display text equals destination), and every
repaired line is byte-identical to its pre-DefectDojo#15661 counterpart.

No NUL bytes remain anywhere under docs/, and a regex sweep for markdown link
openers with no `](` destination now reports zero hits across docs/content.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@devGregA devGregA changed the title docs(connectors): restore three markdown links mangled into NUL bytes in the upstream tool reference docs: restore eight markdown links mangled into NUL bytes Aug 20, 2026
@devGregA

Copy link
Copy Markdown
Contributor Author

GitHub cannot render a text diff for three of the five files: the old blob has a NUL byte inside git's 8000-byte binary-detection window, so they show as Bin / +0/-0 above. Those changes are reproduced here so they can be reviewed without fighting the binary diff.

Each NUL byte is written as <NUL> below. In every case the only edit is the placeholder becoming the link destination - nothing else on the line changed.

docs/content/get_started/about/about_defectdojo.md

@@ line 108 @@
-A running example of DefectDojo (Open-Source Edition) is available at [https://demo.defectdojo.org/<NUL>18<NUL>.
+A running example of DefectDojo (Open-Source Edition) is available at [https://demo.defectdojo.org/](https://demo.defectdojo.org/).
@@ line 113 @@
-[https://pro.demo.defectdojo.com/<NUL>19<NUL>.
+[https://pro.demo.defectdojo.com/](https://pro.demo.defectdojo.com/).

docs/content/get_started/contributing/documentation.md

@@ line 21 @@
-4. Visit [http://localhost:1313<NUL>17<NUL>.
+4. Visit [http://localhost:1313](http://localhost:1313).

docs/content/issue_tracking/pro_integration/messaging_connectors.md

@@ line 38 @@
-1. Go to [https://api.slack.com/apps<NUL>22<NUL> and select **Create New App**, then **From scratch**.
+1. Go to [https://api.slack.com/apps](https://api.slack.com/apps) and select **Create New App**, then **From scratch**.

The other two files (connectors/upstream/toolreference.md, get_started/contributing/how-to-write-a-parser.md) diff as text in the Files tab, because their first NUL byte falls past that 8000-byte window.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant