T09 · Insecure Skill Coding Practices
- Location
check_temperature.sh:7- Finding
Hardcoded SNMP Community String Transmitted over SNMPv2c
- Content
View full analysis
Vulnerability Details
File Location:
check_temperature.sh:7-14(also documented inSKILL.md:13-17andSKILL.md:52-57)
Vulnerability Type: Hardcoded credential and plaintext network protocol
Risk Level: Mediumbash # SNMP target: dgx-spark1.fiber.house, v2c, community "licpub" # MIB: LM-SENSORS (UCD-SNMP-MIB) OID 1.3.6.1.4.1.2021.13.16.2.1 SNMPDST="dgx-spark1.fiber.house" COMMUNITY="licpub" OID_BASE="1.3.6.1.4.1.2021.13.16.2.1" # Fetch all name/value columns WALK=$(snmpwalk -v2c -c "$COMMUNITY" "$SNMPDST" "$OID_BASE" 2>/dev/null)Technical Analysis
The script embeds the SNMP community string
licpubdirectly in source code and uses it with SNMPv2c. SNMPv2c does not provide encryption, message confidentiality, or cryptographically secure peer authentication. Consequently, the community string can be recovered by anyone who can read the repository or observe relevant network traffic.The credential, target hostname, OID, and additional internal infrastructure details are also explicitly disclosed in
SKILL.md. Although the community is described as read-only, it remains a reusable access credential and should not be committed to a distributable Skill package.Exploitation requires either access to the repository or a network position capable of observing SNMP traffic, plus network reachability to the configured SNMP service. No command-injection or arbitrary-code-execution path was identified.
Attack Path
- An attacker obtains the Skill package or otherwise reads its source code.
- The attacker extracts the target
dgx-spark1.fiber.houseand community stringlicpub. - If the attacker can reach the target's SNMP service, they issue SNMPv2c queries using the exposed community string.
- Alternatively, an attacker monitoring the relevant network captures the unencrypted SNMPv2c community string and replays it.
- The attacker enumerates information exposed by the commun ...[truncated 802 chars]
- Remediation
View remediation
Remediation Suggestions
- Migrate to SNMPv3 with authentication and privacy, using strong authentication and encryption algorithms supported by the environment.
- Remove the community string from source code and documentation. Obtain any required credential from a protected secret manager, credential file with restrictive permissions, or an environment variable supplied at runtime.
- Rotate the exposed
licpubcommunity string after removing it from the repository and its history. - Restrict SNMP access with host firewall rules, network ACLs, management-network segmentation, and source-address allowlisting.
- Limit the SNMP identity to the smallest necessary OID view, such as only the required LM-SENSORS subtree.
- Remove unnecessary internal hostname, physical location, operating-system, kernel, and architecture details from distributable documentation.
- Avoid exposing credentials in process arguments where feasible, because command-line arguments may be visible to other local users. Use a protected SNMP configuration mechanism supported by the deployed tooling.
