-
Problem report
-
Resolution: Unresolved
-
Trivial
-
None
-
7.2.12, 7.4.2
-
None
-
Windows Server 2025, 64-Bit, PowerShell Scripts, UTF-8 Encoding
Zabbix Agent 2 crash on Windows Server 2025 when using system.run[]
Description / Problem report (English translation)
Problem:
Zabbix Agent 2 crashes on Windows Server 2025 when certain system.run[] UserParameters are executed. The crash reproducibly occurs with UTF-8 / PowerShell scripts.
Reproduction steps
- Install Zabbix Agent 2 version 7.2.12 or 7.4.x on Windows Server 2025 (64-bit).
- Configure in zabbix_agent2.conf:
AllowKey=system.run[powershell.exe*] Plugins.SystemRun.LogRemoteCommands=0 UserParameterDir=C:\Scripts\Zabbix
- Place a PowerShell script, e.g.: C:\Scripts\Zabbix\Install-PSWindowsUpdate.ps1
- Create an item key on the server or locally:
system.run[powershell.exe -ExecutionPolicy Bypass -File C:\Scripts\Zabbix\Install-PSWindowsUpdate.ps1]
- Start the agent:
.\zabbix_agent2.exe
Observed behavior
The agent starts but then immediately crashes:panic: runtime error: invalid memory address or nil pointer dereference [signal 0xc0000005 code=0x0 addr=0x0 pc=0x8eaf8b] ... golang.zabbix.com/agent2/plugins/systemrun.(*Plugin).Export
- Only certain system.run[] keys cause the crash. Other keys run fine.
Expected behavior
The agent should execute the script without crashing, independent of encoding or path names.
Environment
- OS: Windows Server 2025, 64-bit
- Zabbix Agent 2 versions: 7.2.12, 7.4.x
- UTF-8 / PowerShell scripts
- Configuration: AllowKey=system.run[powershell.exe*]
Attachments
(Options: place or browse files to attach.)
Activity / Comments (translated)
Oldest first
Comment collapsed: Thorsten Hering added a comment - 2025 Sep 25 15:13
Thorsten Hering added a comment - Yesterday
Additional notes:
- The problem only occurs when AllowKey is set for system.run.
- Without AllowKey, the agent runs normally.
- Likely an encoding problem with parameters passed to system.run[].
- UTF-8 / UTF-16 parameters could be causing the crash.
Comment collapsed: Thorsten Hering added a comment - 2025 Sep 25 15:20
Thorsten Hering added a comment - Yesterday
Technical details / suspicion:
- The crash occurs in the function golang.zabbix.com/agent2/plugins/systemrun.(*Plugin).Export.
- Suspected error in UTF-16 conversion of parameters, specifically at:
syscall.UTF16PtrFromString(params[0]) * If params[0] contains invalid or unexpected characters, this can lead to a nil pointer dereference (panic).
- Only certain system.run[] keys trigger the crash; other keys without special characters work correctly.