Skip to content

RDKEMW-15199:[SECVULN] Command injection via /opt/.telemetry/dca_temp…#355

Merged
shibu-kv merged 5 commits into
developfrom
topic/RDKEMW-15199
May 4, 2026
Merged

RDKEMW-15199:[SECVULN] Command injection via /opt/.telemetry/dca_temp…#355
shibu-kv merged 5 commits into
developfrom
topic/RDKEMW-15199

Conversation

@dharshini555
Copy link
Copy Markdown
Contributor

…_file.conf

…_file.conf

Signed-off-by: PriyaDharshini_Kathiravan <priyakathiravan05@gmail.com>
Copilot AI review requested due to automatic review settings April 28, 2026 08:05
@dharshini555 dharshini555 requested a review from a team as a code owner April 28, 2026 08:05
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Addresses a reported command-injection vector by adding validation/sanitization for XConf-provided top_log.txt marker search strings before accepting them into the profile.

Changes:

  • Added <ctype.h> dependency and introduced sanitize_string() helper.
  • Added validation check for TopMarker (top_log.txt) ref/search string in addParameter().

Comment thread source/t2parser/t2parserxconf.c Outdated
Comment thread source/t2parser/t2parserxconf.c Outdated
Comment on lines +157 to +161
if(sanitize_string(strdup(ref)) != 0)
{
T2Error("Parameter can't be added as invalid search string encountered\n");
return T2ERROR_FAILURE;
}
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sanitize_string(strdup(ref)) can crash on OOM because strdup(ref) may return NULL and sanitize_string() dereferences its argument. Also, since you only need to validate characters, avoid allocating/freeing altogether by validating ref directly (or fail early if ref is empty/invalid) before storing it in tMarker->searchString.

Copilot uses AI. Check for mistakes.
Comment thread source/t2parser/t2parserxconf.c Outdated
Comment on lines +157 to +161
if(sanitize_string(strdup(ref)) != 0)
{
T2Error("Parameter can't be added as invalid search string encountered\n");
return T2ERROR_FAILURE;
}
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New security behavior (rejecting invalid top_log.txt search strings) should be covered by unit tests to prevent regressions. There are existing gtests for XConf parsing (e.g., source/test/t2parser/t2parserxconfTest.cpp), but none assert that a profile with an invalid content/search string is rejected.

Copilot generated this review using guidance from repository custom instructions.
Comment thread source/t2parser/t2parserxconf.c Outdated
Comment thread source/t2parser/t2parserxconf.c Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 28, 2026 10:36
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 5 comments.

Comment thread source/t2parser/t2parserxconf.c Outdated
Comment thread source/t2parser/t2parserxconf.c Outdated
Comment thread source/t2parser/t2parserxconf.c Outdated
Comment thread source/t2parser/t2parserxconf.c Outdated
Comment thread source/t2parser/t2parserxconf.c Outdated
Copilot AI review requested due to automatic review settings April 30, 2026 02:59
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.

Comment thread source/t2parser/t2parserxconf.c Outdated
Comment thread source/t2parser/t2parserxconf.c Outdated
Comment thread source/t2parser/t2parserxconf.c Outdated
Comment thread source/t2parser/t2parserxconf.c Outdated
Comment thread source/t2parser/t2parserxconf.c Outdated
@shibu-kv
Copy link
Copy Markdown
Contributor

shibu-kv commented May 4, 2026

Bypassing L2 failures and merging as the test failures are not from these changes. Test failures appear to be due to test docker infrastructure changes from recent release - https://github.com/rdkcentral/docker-device-mgt-service-test/releases/tag/1.7.13

@shibu-kv shibu-kv merged commit 0e0bb32 into develop May 4, 2026
13 of 15 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators May 4, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants