[bug-yhg8dqypwmar] fix(check-naming): reject hidden provenance #4
@@ -40,6 +40,7 @@ VISIBLE_BODY=$(printf '%s\n' "${BODY}" | awk '
|
||||
|
||||
visible=""
|
||||
pos=1
|
||||
backslash_run=0
|
||||
while (pos <= length(line)) {
|
||||
if (in_comment) {
|
||||
rest=substr(line, pos)
|
||||
@@ -51,16 +52,11 @@ VISIBLE_BODY=$(printf '%s\n' "${BODY}" | awk '
|
||||
visible=visible " "
|
||||
pos += comment_end + 2
|
||||
in_comment=0
|
||||
backslash_run=0
|
||||
continue
|
||||
|
|
||||
}
|
||||
|
||||
escaped=0
|
||||
escape_pos=pos - 1
|
||||
while (escape_pos >= 1 && substr(line, escape_pos, 1) == "\\") {
|
||||
escaped++
|
||||
escape_pos--
|
||||
}
|
||||
if (substr(line, pos, 1) == "`" && escaped % 2 == 0) {
|
||||
if (substr(line, pos, 1) == "`" && backslash_run % 2 == 0) {
|
||||
ticks=1
|
||||
|
security
commented
Blocker: You submit The checked
Parse attributes as tokens, then add this exact reproduction. Blocker: You submit `<details title=" open ">` with canonical Tracking and Attribution inside. Gitea preserves the attribute and the browser keeps the disclosure collapsed, but this substring match treats the title value as the boolean `open` attribute. Exact head returns `check-naming: ok`.
The checked `<details open>` path has an unchecked `open`-inside-an-attribute-value twin on this line, and it takes the same hidden provenance.
`title` isn't sanitized away: authenticated `/markdown` returned `<details title=" open ">`. This isn't malformed HTML; it is valid rendered markup and remains collapsed.
Parse attributes as tokens, then add this exact reproduction.
dev
commented
Blocker: this regex matches Blocker: this regex matches ` open ` anywhere in the serialized tag, including a quoted attribute value. `<details title=" open ">` has no boolean `open` attribute, so the browser keeps its provenance collapsed; Gitea preserves that tag and exact-head execution accepts the hidden Tracking and Attribution. Recognize an actual attribute name boundary outside quoted values, then cover this exact body.
ops
commented
Blocker: Blocker: `open` is searched across the whole serialized tag, so an ordinary attribute value containing whitespace-delimited `open` makes a collapsed disclosure visible to this filter. Gitea preserves `<details title="x open y">` without the boolean attribute; putting canonical Tracking and Attribution inside it renders collapsed, but exact head exits 0 with `check-naming: ok`. Match the actual boolean attribute without accepting text inside quoted attribute values, then add this reproduction.
|
||||
while (substr(line, pos + ticks, 1) == "`") ticks++
|
||||
close_pos=pos + ticks
|
||||
@@ -77,6 +73,7 @@ VISIBLE_BODY=$(printf '%s\n' "${BODY}" | awk '
|
||||
if (found_close) {
|
||||
visible=visible substr(line, pos, close_pos + ticks - pos)
|
||||
pos=close_pos + ticks
|
||||
backslash_run=0
|
||||
continue
|
||||
}
|
||||
}
|
||||
@@ -85,9 +82,13 @@ VISIBLE_BODY=$(printf '%s\n' "${BODY}" | awk '
|
||||
visible=visible " "
|
||||
in_comment=1
|
||||
pos += 4
|
||||
backslash_run=0
|
||||
continue
|
||||
}
|
||||
visible=visible substr(line, pos, 1)
|
||||
char=substr(line, pos, 1)
|
||||
visible=visible char
|
||||
if (char == "\\") backslash_run++
|
||||
else backslash_run=0
|
||||
pos++
|
||||
}
|
||||
print visible
|
||||
|
||||
You put canonical provenance inside
<details open>; Gitea preservesopenand shows both sections on load, but this branch incrementsdetails_depthand removes them. The check exits 1 claiming the visible sections are missing. Preserve open disclosure content unless a collapsed ancestor still hides it, and cover that recovery path.