GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — bitwarden-load-secrets: multiline values are split into bogus variables · Issue #5650 · developing-today/code

bitwarden-load-secrets: multiline values are split into bogus variables #5650

New issue
Copy link
New issue
Copy link
Closed
#6325
Closed
bitwarden-load-secrets: multiline values are split into bogus variables#5650
#6325
Copy link
Assignees
dezren39
Labels
area/infraInfrastructure, deployment, and operationseffort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)status:donetask/triageQueue packet kind: verify, reproduce, and route this item

Description

@dezren39
dezren39
opened on Nov 4, 2026
Issue body actions

Finding

bitwarden-load-secrets.sh stores secret records in a newline-delimited PAIRS string (lib/bitwarden-load-secrets.sh:185-196). The BWS and Vault loaders emit raw jq values into tab/newline-delimited records (:223-225, :271-273), and each output mode later reads PAIRS one line at a time (:304-310, :315-320, :323-329). A newline inside a legitimate secret therefore becomes another record instead of remaining part of that secret.

Reproduced with a stub bws returning TLS_CERT = "BEGIN CERT\\nPRIVATE KEY\\nEND CERT": --format json produced TLS_CERT: "BEGIN CERT", plus bogus empty PRIVATE_KEY and END_CERT entries. The script documents direct CLI and sourced use (:5-8, :110-113); no in-repository callers or tests were found.

Why it matters

Multiline values such as private keys and certificates are silently truncated, so consumers receive invalid credentials; continuation text is also exposed as unintended environment-variable names in source/export modes. This is a functional defect in the loader's documented use.

Suggested fix

Keep key/value pairs in a representation that preserves newlines (rather than embedding raw values in a newline-delimited string), and add regression coverage for multiline values across the supported output formats. Shell output values are currently quoted; this finding is about record corruption, not a demonstrated shell-injection path.

Activity

  1. dezren39
    added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    area/infraInfrastructure, deployment, and operations
    effort/sSmall: expected under 2 hours of work
    on Nov 4, 2026
  2. developing-today commented on Nov 4, 2026

    @developing-today
    developing-todayBot
    on Nov 4, 2026 – with developing.today
    Contributor
    More actions

    CODE-1408

  3. github-actions
    assigned
    dezren39
    on Nov 4, 2026
  4. dezren39
    added
    queue/queuedHas a queued queue task
    task/triageQueue packet kind: verify, reproduce, and route this item
    on Nov 5, 2026
  5. dezren39 commented on Nov 5, 2026

    @dezren39
    dezren39
    on Nov 5, 2026
    MemberAuthor
    More actions

    Triage outcome — task 10098 (2026-11-05, lane code-p)

    Verdict: CONFIRMED on current main — reproduced exactly as filed; fix path scoped, follow-up fix task enqueued.

    Fresh verification (2026-11-05): issue #5650 OPEN, labels kind/bug, task/triage, area/infra, effort/s — no held / user/owned / do-not-merge / do-not-auto-edit labels. No competing or duplicate work: no open PR touches lib/bitwarden-load-secrets.sh, an issue search returns only #5650 itself, and git grep on origin/main finds no in-repo callers or tests for the script.

    Code read (origin/main 04f78696ab, lib/bitwarden-load-secrets.sh): PAIRS is a newline-delimited KEY<TAB>VALUE string (:185-196, add_pair appends the raw value). The corruption has TWO stages, and a fix must cover both:

    1. Loader stage — the BWS list loader (:223-225) and the Vault custom-fields loader (:271-273) read jq -r output with while IFS=$'\t' read -r k v, one line at a time: a multiline value is already split there, before PAIRS is involved.
    2. Storage/output stage — single-value paths (:215, :247-287) preserve the multiline value into add_pair, but every output mode re-reads PAIRS line-by-line (source :304-310, export :315-320, env :323-329) and json mode splits each input line on tab (:330-338), splitting the value again.

    Reproduction (laptop probe ~/git/fleet/probe-5650, real script from laptop main 04f78696ab, stub bws): secret TLS_CERT = "BEGIN CERT\nPRIVATE KEY\nEND CERT" plus a sane PLAIN=hello control —

    • --bws --format json → TLS_CERT: "BEGIN CERT" plus bogus "PRIVATE_KEY": "" and "END_CERT": "" entries (sanitized from the continuation lines); control intact.
    • --bws --format export → export TLS_CERT='BEGIN CERT' plus bogus export PRIVATE_KEY= / export END_CERT=.

    Matches the filing exactly (the filed repro's variable spellings differ only by the sanitizer's space handling).

    Fix path (scoped for the follow-up task): give key/value records a newline-safe representation end-to-end — e.g. loaders emit the value base64-encoded (jq @base64) so the read loops never see a raw newline, PAIRS stores the encoded value, and each output mode decodes before quoting/export (json mode decodes so the emitted JSON carries the true multiline string). Any representation with the same property is acceptable; patching only the output readers is NOT sufficient (stage 1 above). Regression coverage: a stub-bws test with a multiline value plus a sane control, asserted across json/export/env (and source-mode variable values), failing pre-fix and passing post-fix. No in-repo callers or existing tests constrain the internal representation.

    agent-note:v1
    {"kind": "triage", "task": 10098, "issue": 5650, "state": "done", "outcome": "confirmed_reproduced_fix_scoped", "evidence": "main 04f7869; PAIRS newline-delimited at lib/bitwarden-load-secrets.sh:185-196; loader read loops :223-225/:271-273; laptop probe reproduced bogus PRIVATE_KEY/END_CERT in json+export"}

  6. dezren39
    added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    and removed
    queue/queuedHas a queued queue task
    on Nov 5, 2026
  7. dezren39 commented on Nov 5, 2026

    @dezren39
    dezren39
    on Nov 5, 2026
    MemberAuthor
    More actions

    🤖 Agent note · picked up

    • Agent: queue worker (repo-worker-code), lane code-q
    • Session / ID: task 10481
    • Found via: queue claim
    • Task: Fix issue bitwarden-load-secrets: multiline values are split into bogus variables #5650 — make lib/bitwarden-load-secrets.sh carry multiline secret values end-to-end without splitting them into bogus variables, with regression coverage.
    • Expectation: effort/s; done = branch + PR with the fix verified, task 10481 completed.
    • Links: issue bitwarden-load-secrets: multiline values are split into bogus variables #5650
  8. developing-today
    added
    status:in-review
    on Nov 5, 2026
  9. dezren39
    added a commit that references this issue on Nov 5, 2026

    Merge pull request #6325 from developing-today/queue/10481-5650-bitwa…

    f0fa320
  10. dezren39
    closed this as completedin #6325on Nov 5, 2026
  11. developing-today
    added
    status:done
    and removed
    status:in-review
    on Nov 5, 2026
  12. dezren39 commented on Nov 5, 2026

    @dezren39
    dezren39
    on Nov 5, 2026
    MemberAuthor
    More actions

    🤖 Agent note · done

    • Agent: queue worker (repo-worker-code), lane code-q
    • Session / ID: task 10481
    • Found via: queue claim
    • Task: Fixed issue bitwarden-load-secrets: multiline values are split into bogus variables #5650 — lib/bitwarden-load-secrets.sh now carries multiline secret values base64-encoded end-to-end (both jq loaders, PAIRS store, single-value paths); output modes decode at output time, json via @base64d, export/env quote the whole value via jq -Rsr @sh.
    • Expectation: done = PR fix(infra): #5650 carry multiline secret values end-to-end in bitwarden-load-secrets #6325 merged (merge sha f0fa320); issue bitwarden-load-secrets: multiline values are split into bogus variables #5650 closed by the merge. Regression tests: scripts/tests/test_bitwarden_load_secrets.py — 6 failures pre-fix, 4 tests OK post-fix (laptop run), wired into scripts-test.yml.
    • Links: PR fix(infra): #5650 carry multiline secret values end-to-end in bitwarden-load-secrets #6325 · branch queue/10481-5650-bitwarden-multiline
  13. dezren39
    removed
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 5, 2026
  14. dezren39
    added a commit that references this issue on Nov 10, 2026

    fix(lib): bitwarden-load-secrets validates value options before parsi…

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

Metadata

Metadata

Assignees

  • @dezren39
    dezren39

Labels

area/infraInfrastructure, deployment, and operationseffort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)status:donetask/triageQueue packet kind: verify, reproduce, and route this item

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.