Closed as not planned
Description
Proposed new feature or change:
Summary
Windows console executables shipped by NumPy (f2py.exe) are built without the /DYNAMICBASE
linker flag, meaning ASLR is disabled.
Why It Matters
ASLR is a standard security mitigation on Windows—executable files without it are easier targets for memory-based exploits. Given that NumPy is widely deployed, enabling ASLR is recommended for all Windows release artifacts.
How to Check
- Download a Windows executable (
f2py.exe
). - Run
dumpbin /headers <exe>
and inspect theDLL characteristics
for/DYNAMIC_BASE
. - Note that the flag is currently missing.
Suggested Fix
- Pass
/DYNAMICBASE
to the linker viaextra_link_args
or appropriate distutils/setuptools configuration. - Modify Windows launcher scripts or use compiled entry-point stubs that include ASLR.
- Validate via CI that ASLR is present on release binaries.
Affected files
- numpy: f2py.exe
Context
Security hardening best practices recommend PIE or dynamic base for all Windows executables.