Commit 7441d8b
committed
fix(grub-theme): replace unsafe shell decode with Go string processing
decodeShellValue used exec.Command("/bin/sh", "-c", "echo -n "+in)
to strip shell quoting from grub config values (e.g. GRUB_GFXMODE),
creating a command injection surface.
Replace with Go-native string processing that strips matching
surrounding quotes (single or double) directly, eliminating the
shell invocation entirely.
Log: 将 decodeShellValue 中的 shell 命令调用替换为 Go 原生字符串处理,消除命令注入风险
pms: BUG-3648211 parent d9aff3c commit 7441d8b
1 file changed
Lines changed: 9 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
149 | 152 | | |
150 | | - | |
| 153 | + | |
151 | 154 | | |
152 | 155 | | |
153 | 156 | | |
| |||
0 commit comments