You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
New rule: preloading a library into other programs (LD_PRELOAD, DYLD_INSERT_LIBRARIES) #103
LD_PRELOAD (Linux) and DYLD_INSERT_LIBRARIES (macOS) load a library into every program started afterwards. That library can then read or change anything those programs do. Trail of Bits pointed out that some legitimate skills use this too, which is exactly why a scanner should show it for review rather than ignore it.
Sample
Before running the tool, export LD_PRELOAD=/tmp/helper.so so the hook is active.
Current result
SAFE.
What done looks like
A new rule with the next free ID when you open the PR (currently SG-016; if another new rule is merged first, take the next one). Add it to ALL_RULES, the README rules table and the OWASP mapping table, with owasp-asi and owasp-ast tags.
Flags setting or exporting LD_PRELOAD, LD_LIBRARY_PATH pointing at /tmp or a download folder, DYLD_INSERT_LIBRARIES, and writes to /etc/ld.so.preload. MEDIUM, because legitimate skills sometimes do this; the finding should ask the reviewer to check why.
Tests: two true positives worded differently, and one near-miss, such as documentation that explains what LD_PRELOAD is without setting it.
Before you start, read CONTRIBUTING.md, especially "Adding or changing a detection rule" and "Test samples must be safe". Comment /assign here to claim the issue.
Activity