Back to skill

Security audit

rpm-packager

Security checks for vulnerabilities and agentic risk

Overview

This RPM packaging skill matches its stated purpose, but its bundled build script can turn crafted package metadata into command execution or unintended file writes during a build.

Install only if you understand RPM build workflows and will use trusted package metadata. Run builds as an unprivileged user, preferably in mock or another isolated build environment, and avoid using untrusted package names, versions, releases, or RPM_BUILDER_NAME values until the script adds strict validation.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/build-rpm.sh:6
Finding

RPM SPEC Injection Through Unvalidated Package Metadata

Content
View full analysis
"$SPEC_FILE" << EOF Name: ${PACKAGE_NAME} Version: ${VERSION} Release: ${RELEASE}%{?dist} Summary: ${PACKAGE_NAME} application License: MIT URL: https://example.com/${PACKAGE_NAME} Source0: %{name}-%{version}.tar.gz BuildRequires: gcc make Requires: glibc %description ${PACKAGE_NAME} - Built from source automatically %prep %setup -q %build %configure make %{?_smp_mflags} %install make install DESTDIR=%{buildroot} %files %defattr(-,root,root,-) %{_bindir}/${PACKAGE_NAME} %changelog * $(date +%a\ %b\ %d\ %Y) ${RPM_BUILDER_NAME} - ${VERSION}-${RELEASE} - Initial package build EOF log_info "SPEC file generated" echo "$SPEC_FILE" } ``` ```bash build_rpm() { local SPEC_FILE="$1" log_info "Building RPM package..." rpmbuild -ba "$SPEC_FILE" 2>&1 | tee "$RPM_BUILD_DIR/BUILDLOGS/${PACKAGE_NAME}-${VERSION}.log" ``` ### Technical Analysis The script accepts `PACKAGE_NAME`, `VERSION`, and `RELEASE` from positional arguments and `RPM_BUILDER_NAME` from the environment without validating their syntax. These values are inserted directly into an RPM SPEC file. Shell quoting around `cat > "$SPEC_FILE"` protects the destination filename from shell word ...[truncated 1820 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/build-rpm.sh:6
Finding

Path Traversal and Unsafe Output File Handling

Content
View full analysis
"$SPEC_FILE" << EOF ``` ```bash build_rpm() { local SPEC_FILE="$1" log_info "Building RPM package..." rpmbuild -ba "$SPEC_FILE" 2>&1 | tee "$RPM_BUILD_DIR/BUILDLOGS/${PACKAGE_NAME}-${VERSION}.log" ``` ### Technical Analysis `PACKAGE_NAME` and `VERSION` are incorporated into archive, SPEC, and log paths without rejecting path separators or traversal components. Shell quoting prevents argument splitting but does not stop path resolution by the operating system. Values containing components such as `..` can cause a destination to resolve outside `SOURCES`, `SPECS`, or `BUILDLOGS`. The archive is created with `tar -czf`, the SPEC is opened using shell redirection, and the log is opened by `tee`. These operations can create or truncate files. No canonical-path containment check is performed, and there is no explicit protection against pre-existing symbolic links at the destination. Exploitation is constrained by generated filename suffixes and by the filesystem permissions of the builder account, but output can still be redirected o ...[truncated 1336 chars]
Remediation
View remediation
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Rogue AgentSelf-Modification, Session Persistence
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (6)

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · SKILL.md (reported line 3)May include surrounding context.

md
---
name: rpm-packager
description: Build RPM packages from source code for CentOS/RHEL systems. Use when user needs to: (1) package software source into installable RPM, (2) create SPEC files, (3) build packages for CentOS 7/8/9 or RHEL, (4) prepare software for distribution on RPM-based Linux systems.
---

# RPM Packager Skill

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · SKILL.md (reported line 31)May include surrounding context.

2. Check Prerequisites

Required tools on CentOS/RHEL (requires sudo privileges):

bash
sudo yum install rpm-build mock gcc make

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · SKILL.md (reported line 33)May include surrounding context.

2. Check Prerequisites

Required tools on CentOS/RHEL (requires sudo privileges):

bash
sudo yum install rpm-build mock gcc make

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · SKILL.md (reported line 56)May include surrounding context.

2. Check Prerequisites

Required tools on CentOS/RHEL (requires sudo privileges):

bash
sudo yum install rpm-build mock gcc make

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · SKILL.md (reported line 59)May include surrounding context.

md
if [ ${#missing[@]} -ne 0 ]; then
        log_error "Missing required tools: ${missing[*]}"
        log_info "Install with: sudo yum install rpm-build mock"
        exit 1
    fi

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/build-rpm.sh (reported line 41)May include surrounding context.

sh
if [ ${#missing[@]} -ne 0 ]; then
        log_error "Missing required tools: ${missing[*]}"
        log_info "Install with: sudo yum install rpm-build mock"
        exit 1
    fi