Scripts: harden _yieldomega_env_set_line sed escaping in kumbaya_local_anvil_env.sh (151-3) #154
Labels
No labels
agent:fix_bugfix
agent:fix_conflicts
agent:fix_security
agent:gap_analysis
agent:implement
agent:open_issues
agents
agent:security_audit
agent:verify
area
timecurve
arena
arena-v2
audit
block:feature_review
block:security
bug
contracts
design
devops
docs
documentation
enhancement
epic
feature
frontend
indexer
low priority
megaeth
operations
ops
performance
QA
qa checklist
referrals
removal
security
smart-contracts
tech-debt
testing
time-arena
timecurve
visual-qa
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
code/yieldomega#154
Loading…
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?
Problem
_yieldomega_env_set_lineinscripts/lib/kumbaya_local_anvil_env.shusessed -iwith${key}and${val}interpolated unescaped into the pattern and replacement. The header comment says values are “hex addresses” today; future callers could pass&,\,#, or newlines and get silent corruption offrontend/.env.local(sed&backreference, early#terminator, etc.).Call sites today:
yieldomega_frontend_merge_kumbaya_vite_fullandyieldomega_frontend_merge_vite_kumbaya_buy_router_only— all 0x addresses and safe keys. This is preventive hardening before a future value breaks the helper.Split from GitLab #151 (Finding 3 — Low). Kumbaya local env: GitLab #84.
Related code & docs
scripts/lib/kumbaya_local_anvil_env.sh—_yieldomega_env_set_line(~lines 38–54)yieldomega_frontend_merge_kumbaya_vite_full,yieldomega_frontend_merge_vite_kumbaya_buy_router_onlyscripts/start-local-anvil-stack.sh,scripts/lib/anvil_deploy_dev.sh,scripts/e2e-anvil.shdocs/integrations/kumbaya.md— localnet Anvil,VITE_KUMBAYA_*docs/testing/invariants-and-business-logic.md— Kumbaya / #84 if referenced.cursor/skills/yieldomega-guardrails/SKILL.md(item 21)Contracts / indexer / frontend app code: No change required unless tests are added under
scripts/or shellspec-style checks.Acceptance criteria
&\#/) do not corruptfrontend/.env.local— either by escaping for GNUsedor by replacing the implementation withawk, Python one-liner, or another tool that treats values as literal strings.KEY=line or append with the Kumbaya marker block per current behavior.YIELDOMEGA_DEPLOY_KUMBAYA=1local stack ande2e-anvil.shstill produce correctVITE_KUMBAYA_*lines (spot-check addresses matchlocal-anvil-registry.json/ onchain).Verification checklist
bash scripts/start-local-anvil-stack.shwithYIELDOMEGA_DEPLOY_KUMBAYA=1(or repo-documented minimal path) and confirmfrontend/.env.localcontains expectedVITE_KUMBAYA_*lines (compare to prior behavior /kumbaya.md)._yieldomega_env_set_linewith a value containing&and#; file should show exact value on theKEY=line (no substitution artifacts). Remove temp test if not committed.sed, verify GNU sed on Linux (project default) — document if macOS/BSD requires different flags (repo may already assume Linux for dev).^KEY=.shellcheck scripts/lib/kumbaya_local_anvil_env.shif project uses it; fix new warnings.docs/integrations/kumbaya.mddescribes env merging, add one line that values are written via a safe line editor (optional).marked this issue as related to #151
mentioned in issue #151
marked this issue as related to #84
mentioned in commit
6d2f32e404Fix merged to
main(6d2f32e)What changed
sed-based_yieldomega_env_set_lineinscripts/lib/kumbaya_local_anvil_env.shwith a small Python helperscripts/lib/kumbaya_env_set_line.pythat rewritesKEY=valuelines as literal UTF-8 (nosed&/#substitution surprises).^KEY=line (same as before) or append after the Kumbaya marker block.bash scripts/test-kumbaya-env-set-line.sh(also runs in CIscripts-smokejob in.github/workflows/unit-tests.yml).INV-KUMBAYA-ENV-154indocs/testing/invariants-and-business-logic.md,docs/integrations/kumbaya.md(Localnet anchor),docs/testing/strategy.md,skills/README.md,.cursor/skills/yieldomega-guardrails/SKILL.mditem 21.@brouie — verification checklist
bash scripts/test-kumbaya-env-set-line.shpasses locally.YIELDOMEGA_DEPLOY_KUMBAYA=1stack path still writes expectedVITE_KUMBAYA_*lines infrontend/.env.local(spot-check vslocal-anvil-registry.json/ onchain as in kumbaya.md Localnet).unit-testsworkflow includes greenscripts-smokejob.Issue left open for your sign-off.
@PlasticDigits — verification PASS on
6d2f32eat HEAD435a446. walked your checklist:bash scripts/test-kumbaya-env-set-line.sh:ok kumbaya_env_set_line tests— green.scripts/lib/kumbaya_env_set_line.pypresent (1999 bytes);scripts/lib/kumbaya_local_anvil_env.shupdated to call the Python helper at L41, header comment at L39 documents the literal-bytes semantic.grep -n 'sed -i' scripts/lib/kumbaya_local_anvil_env.sh: zero matches. no remnant sed calls. clean replacement.scripts-smokeworkflow.ready for close on your end.
mentioned in commit
f2d2d8b6ec