Qt Positioning Security Considerations
This page highlights potential security issues that can arise when using the module and suggests how to avoid them.
Plugins
The module uses a plugin system to select a backend at runtime. This selection can be based either on the platform or on an explicit request from the application.
Prevent loading malicious plugins
The plugin system gives an attacker an opportunity to get a malicious plugin loaded into the application. Because a plugin is a shared library running in the application's process, it can execute arbitrary code with the application's privileges.
The Qt plugins documentation gives an overview of how plugins are located and loaded, and of what affects the lookup paths. Making sure that no untrusted plugin is reachable through those paths is the responsibility of the application developer. When deploying an application, verify that:
- The Qt installation and application directories cannot be modified by untrusted users.
- If the application uses a
qt.conffile, its contents are correct, and untrusted users cannot modify the file. - Untrusted parties cannot control the process environment, because variables such as
QT_PLUGIN_PATHextend the plugin lookup paths.
An application can also call QCoreApplication::setLibraryPaths() at startup to set the lookup paths explicitly. The paths set this way still need to be protected from modification by untrusted users.
Avoid test mode in production
To keep automated tests deterministic, the module ignores all production plugins when the QT_QTESTLIB_RUNNING environment variable is set. As a result, no position or satellite source is available to the application. Make sure that this variable is not set in a production environment.
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.