sonic-buildimage/device/celestica/x86_64-cel_seastone_2-r0
Mai Bui 51a1eb112b
[device/celestica] Mitigation for command injection vulnerability (#11740)
Signed-off-by: maipbui <maibui@microsoft.com>
Dependency: [PR (#12065)](https://github.com/sonic-net/sonic-buildimage/pull/12065) needs to merge first.
#### Why I did it
1. `eval()` - not secure against maliciously constructed input, can be dangerous if used to evaluate dynamic content. This may be a code injection vulnerability.
2. `subprocess()` - when using with `shell=True` is dangerous. Using subprocess function without a static string can lead to command injection.
3. `os` - not secure against maliciously constructed input and dangerous if used to evaluate dynamic content.
4. `is` operator - string comparison should not be used with reference equality.
5. `globals()` - extremely dangerous because it may allow an attacker to execute arbitrary code on the system
#### How I did it
1. `eval()` - use `literal_eval()`
2. `subprocess()` - use `shell=False` instead. use an array string. Ref: [https://semgrep.dev/docs/cheat-sheets/python-command-injection/#mitigation](https://semgrep.dev/docs/cheat-sheets/python-command-injection/#mitigation)
3. `os` - use with `subprocess`
4. `is` - replace by `==` operator for value equality
5. `globals()` - avoid the use of globals()
2022-12-09 10:30:20 -05:00
..
plugins [device/celestica] Mitigation for command injection vulnerability (#11740) 2022-12-09 10:30:20 -05:00
Seastone_2 [BRCMSAI 6.0.0.13-1] Fix Cancun file directory at new location causing TD3 platform boot issue (#9922) 2022-02-07 08:56:06 -08:00
sonic_platform_config [Celestica Seastone2] Build correct platform files (#9660) 2022-01-16 12:11:28 +05:30
custom.bin [Celestica/Seastone2] Add support Seastone2 device and platform (#3761) 2020-01-15 18:42:09 -08:00
default_sku [Celestica/Seastone2] Add support Seastone2 device and platform (#3761) 2020-01-15 18:42:09 -08:00
installer.conf [Celestica/Seastone2] Add support Seastone2 device and platform (#3761) 2020-01-15 18:42:09 -08:00
led_proc_init.soc [Celestica/Seastone2] Load interface LEDs (#9769) 2022-01-19 00:42:51 -08:00
linkscan_fw.bin [Celestica/Seastone2] Add support Seastone2 device and platform (#3761) 2020-01-15 18:42:09 -08:00
platform_asic Add platform_asic file to each platform folder in sonic-device-data based package (#8542) 2021-10-08 19:27:48 -07:00
pmon_daemon_control.json [device/celestica]: Implement Seastone2 platform API (#5080) 2020-09-09 10:32:56 -07:00