vault-import.sh: pipe-separator in ops_data/paths_to_write silently truncates secret values containing | #898
Labels
No labels
action
backlog
blocked
bug-report
cannot-reproduce
in-progress
in-triage
needs-triage
prediction/actioned
prediction/dismissed
prediction/unreviewed
priority
rejected
reproduced
tech-debt
underspecified
vision
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: disinto-admin/disinto#898
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Flagged by AI reviewer in PR #889.
Problem
tools/vault-import.shserializes each entry inops_dataas"${source_value}|${status}"(line 498). Extraction at lines 510-511 uses${data%%|*}(first field) and${data##*|}(last field). Ifsource_valuecontains a literal|,${data%%|*}truncates it to the first segment, silently writing a corrupted value to Vault.The same separator is used in
paths_to_write(line 519) to join multiple kv-pairs for a path. WhenIFS="|"splits the string back into an array (line 540), a value containing|is split across array elements, corrupting the write.Failure mode
Any secret value with a pipe character (e.g. a generated password or composed token like
abc|xyz) is silently truncated or misrouted on import. No error is emitted.Fix
Replace the
|-delimited string with a bash indexed array for accumulating per-path kv pairs, eliminating the need for a delimiter that conflicts with possible value characters.Auto-created from AI review of PR #889
Affected files
tools/vault-import.sh— replace pipe-delimited string accumulation with bash indexed arrays (lines ~498–540)Acceptance criteria
|(e.g.abc|xyz) is imported to Vault without truncation or corruption|shellcheckclean