-
-
Notifications
You must be signed in to change notification settings - Fork 230
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
Literal not obfuscated when injecting via -ldflags="-X ..." #717
Comments
This is a TODO; see garble/testdata/script/ldflags.txtar Line 21 in 9044b1d
It's not trivial because such literals are currently inserted at link time, well after garble's obfuscation at the source level has happened. To support this, we would have to stop passing the |
What version of Garble and Go are you using?
What environment are you running Garble on?
docker container linux/amd64 golang:1.20
go env
OutputWhat did you do?
garble -literals build -ldflags="-X 'main.literal=THIS SHOULD BE OBFUSCATED'" -o main
I expected the resulting binary to contain an obfuscated variable due to the
-literals
flag, but inspecting the binary withstrings
includes the value "THIS SHOULD BE OBFUSCATED".To reproduce:
Then run:
The Docker build fails, showing that the plain string was found in the binary rather than an obfuscated version.
What did you expect to see?
The Docker build should succeed, showing that the plain string was not found in the binary.
What did you see instead?
The Docker build failed, showing that the plain string was found in the binary.
The text was updated successfully, but these errors were encountered: