π‘οΈ Sentinel: [HIGH] Fix command injection in wifi script#159
π‘οΈ Sentinel: [HIGH] Fix command injection in wifi script#159ManupaKDU wants to merge 1 commit into
Conversation
Add regex validation for data.mbssid and num_global_macaddr in the prepare function before interpolating them into fs.popen shell commands. This prevents arbitrary shell command injection if user-provided wifi configurations contain malicious shell characters. Signed-off-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> Co-authored-by: manupawickramasinghe <73810867+manupawickramasinghe@users.noreply.github.com>
|
π Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a π emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
π¨ Severity: HIGH
π‘ Vulnerability: Command Injection. In
package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/iface.uc, thepreparefunction interpolatesnum_global_macaddranddata.mbssiddirectly into anfs.popen()command string without prior validation.π― Impact: If an attacker can control the wireless interface configuration, they can supply malicious shell metacharacters (e.g.,
;,&,|) in thembssidornum_global_macaddrfields, resulting in arbitrary shell command execution with root privileges.π§ Fix: Mirrored the existing secure
macaddr_basevalidation by checking thatnum_global_macaddranddata.mbssidcontain only numeric digits (/[^0-9]/) before thefs.popencall, terminating the function with a warning if invalid characters are present.β Verification: Ran
sh test_ci.shto ensure no syntax errors or regressions were introduced in the full OpenWrt environment.Signed-off-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
PR created automatically by Jules for task 14042704613632197757 started by @manupawickramasinghe