3

Since Wasm is written in non-human-readable form, does this make it nigh-on impossible for a hacker to look at the Wasm files of a site and figure out what's what?

I know it's never considered best practice to keep sensitive data on the client-side, but Wasm seems to be a bit of a game-changer when it comes to code obscurity (unless I've missed something somewhere).

Everything looks like this:

In-browser Wasm files and code

I don't see how any information can be gleaned from that.

For a bit of context, the reason I'm asking this is because I'm creating a password protected admin area for my Blazor website. I'm wondering if it's safe to deal with password entry entirely on the client side, simply for the joy of making the user experience that little bit faster (no need for a server call).

Code example below:

// page.razor

// C#

@functions{

    string password = "";

    private void Login()
    {
        if(password == "thisBeThePassword")
        {
            UriHelper.NavigateTo("/adminArea/" + password);
            //adminArea component recieves password as parameter for gaining access
        }
    }
}

// Razor/Blazor HTML

<input type="password" bind="@password"/>

<button onclick=@Login>Login</button>
4

1 Answer 1

8

Answers have come swiftly in the comments!

WASM can be decompiled, so no it's never a good idea to deal with sensitive information on the client-side.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.