Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ftype issue #298

Open
Thomasw2802 opened this issue Apr 24, 2024 · 2 comments
Open

Ftype issue #298

Thomasw2802 opened this issue Apr 24, 2024 · 2 comments

Comments

@Thomasw2802
Copy link

Hello,

I want to talk about a issue I encountered while using fapolicyd.

I tried to make rules using ftype option but I found out that it's very easy to manipulate a file ftype.
For instance, if I have a python file and I write on my first line #!/bin/bash, the ftype detected will be text/x-shellscript.
So, if I have a rule that deny python ftype it will be easy for an attacker to bypass it.
exploit_photo
image

Is it safe to use this option ?

@stevegrubb
Copy link
Member

What happens when you try to run that file with bash?

@Thomasw2802
Copy link
Author

Thomasw2802 commented Apr 24, 2024

It doesn't work because the syntax is python but if i run it with python it works (i have a rule that deny python ftype).

I can have a text/plain ftype with a python script as well because ftype is based on magic number if i'm not mistaken.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants