Why does Blender think this driver expression is a security issue?
The problem isn't with the specific driver you've implemented, but with python scripts in general. The automatic execution of all python scripts is disabled by default.
From the Blender 2.90 Manual:

The ability to include Python scripts within blend-files is valuable
for advanced tasks such as rigging and automation. However, it poses a
security risk since Python does not restrict what a script can do.
Therefore, you should only run scripts from sources you know and
trust.
Automatic execution is disabled by default, however, some blend-files
need this to function properly.

This is mostly an issue when you are opening a Blender file which you didn't yourself make. It could contain any conceivable script.
In Blender Preferences &gt; Save &amp; Load there is a checkbox to Auto Run Python Scripts. You can add excluded paths to, for example, your downloads folder, so that foreign blend files are still restricted.
You can also manually enable scripts in specific blend files as you open then, by checking the Trusted Source box in the File Browser.