Repository navigation
RDKEMW-28109: Fix high severity security findings in sysint scripts - #644
Open
sanalachary wants to merge 1 commit into
Open
sanalachary wants to merge 1 commit into
sanalachary wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved cache-symlink handling allows the root service to overwrite symlink targets, and the partner-ID fallback bypasses validation before entering a shell-command string.
4 open issues
What changed in this PR
This PR hardens SysInt scripts that supply device identity, metadata, firmware requests, and time-server configuration, targeting command injection and unsafe temporary-file handling.
Changes:
- Adds allowlists for identity values, device parameters, and NTP server names.
- Replaces signing-command
evalwith direct invocation and removes the temporary bootstrap-file copy. - Introduces atomic device-metadata writes and ownership/symlink checks.
| File | Description |
|---|---|
lib/rdk/xconfImageCheck.sh |
Calls GetServiceUrl directly instead of through eval. |
lib/rdk/timesyncd-conf-update.sh |
Validates NTP server names and uses fixed-string matching. |
lib/rdk/getPartnerId.sh |
Validates retrieved partner IDs and suppresses TR-181 stderr. |
lib/rdk/getDeviceId.sh |
Reads partner bootstrap data directly from its source. |
lib/rdk/getDeviceDetails.sh |
Adds atomic writes, file trust checks, and safer cache updates. |
lib/rdk/getAccountId.sh |
Replaces account-ID character checks with an allowlist. |
Review effort: Balanced
Comment on lines
+626
to
+627
| if [ -e "$deviceDetailsCache" ] || [ -L "$deviceDetailsCache" ]; then | ||
| if [ -L "$deviceDetailsCache" ] || [ ! -O "$deviceDetailsCache" ]; then |
Comment on lines
+71
to
+73
| case "$partnerName" in | ||
| *[!A-Za-z0-9._-]*) partnerName="" ;; | ||
| esac |
| *) continue ;; | ||
| esac | ||
| file="/tmp/.$param" | ||
| if [ -f "$file" ] && [ ! -L "$file" ] && [ "$(head -n 1 "$file")" != "" ]; then |
| if grep -q "$host" /etc/systemd/timesyncd.conf; then | ||
| # Allowlist: hostnames are interpolated into a sed program below | ||
| case "$host" in | ||
| *[!A-Za-z0-9.-]*) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
Addressed Mythos/SysInt high severity findings in:
getDeviceDetails.sh:
rdkcentral-sysint_High_007
rdkcentral-sysint_High_009
rdkcentral-sysint_High_020
rdkcentral-sysint_High_022
rdkcentral-sysint_High_023
rdkcentral-sysint_High_031
rdkcentral-sysint_High_037
getPartnerId.sh:
rdkcentral-sysint_High_026
getDeviceId.sh:
rdkcentral-sysint_High_036
getAccountId.sh:
rdkcentral-sysint_High_010
timesyncd-conf-update.sh:
rdkcentral-sysint_High_038
Changes