Skip to content

Binaries produced by .Net Maui compile on Android does not enable security flags #9786

@paul-kiar

Description

@paul-kiar

Description

When you build a .Net Maui project it generates binaries that do not have all the security flags turned on.

Steps to Reproduce

Reproduction steps

Create a new project
Select .Net Maui App
Select .Net 9.0 
Choose Release mode
Build 
Find the output APK
Use apktool to extract the APK
Use checksec tool to verify flags on the .so files inside the APK

Expected that security flags are set on the output binaries

Actually the flags are:

Partial RELRO

No Canary found

NX enabled

DSO

No RPATH

No RUNPATH

Link to public reproduction project repository

No response

Version with bug

8.0.92 SR9.2

Is this a regression from previous behavior?

No, this is something new

Last version that worked well

No response

Affected platforms

Android

Affected platform versions

All

Did you find any workaround?

No response

Relevant log output

Metadata

Metadata

Assignees

Labels

Area: App+Library BuildIssues when building Library projects or Application projects.need-attentionA xamarin-android contributor needs to review

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions