Invalid message: VALIDATION_ERROR_DESERIALIZATION_FAILED

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Invalid message: VALIDATION_ERROR_DESERIALIZATION_FAILED

Postby sshuzaFulcrum » Thu Sep 29, 2022 10:56 am

Terminating render process for bad Mojo message

Hello CEF Forums,

I am trying to get a custom scheme that outputs a text/plain result to appear in a <p> element on my test page.

Image

My Scheme options are:

Image

The console.log works in the function (meaning the response and scheme work), however, the application window immediately turns white as soon as the request button is pressed (the one that runs the function).

Image

In my program's console output shows this error

Code: Select all
[0928/171113.362:ERROR:validation_errors.cc(117)] Invalid message: VALIDATION_ERROR_DESERIALIZATION_FAILED
[0928/171113.362:ERROR:render_process_host_impl.cc(5127)] Terminating render process for bad Mojo message: Received bad user message: Validation failed for content.mojom.FrameHost.9  [VALIDATION_ERROR_DESERIALIZATION_FAILED]
[0928/171113.362:ERROR:bad_message.cc(29)] Terminating renderer for bad IPC message, reason 123
[0928/171113.363:ERROR:interface_endpoint_client.cc(689)] Message 1747846047 rejected by interface content.mojom.FrameHost


The common solutions around such as ensuring that AddCustomScheme is done on every process, the scheme is standard, etc. I have already done and have not fixed the issue.

One user suggested setting a rule in the CSS of the element to indicate that an element change change later, but this is simply not a applicable solution given my constraints.

Any help would be greatly appreciated.
sshuzaFulcrum
Techie
 
Posts: 12
Joined: Tue Sep 27, 2022 9:31 am

Re: Invalid message: VALIDATION_ERROR_DESERIALIZATION_FAILED

Postby magreenblatt » Thu Sep 29, 2022 12:17 pm

The general advice here is not to use a custom scheme. See the bold text at https://bitbucket.org/chromiumembedded/ ... t-handling
magreenblatt
Site Admin
 
Posts: 12402
Joined: Fri May 29, 2009 6:57 pm

Re: Invalid message: VALIDATION_ERROR_DESERIALIZATION_FAILED

Postby sshuzaFulcrum » Thu Sep 29, 2022 1:27 pm

magreenblatt wrote:The general advice here is not to use a custom scheme. See the bold text at https://bitbucket.org/chromiumembedded/ ... t-handling



hmm I need to have a custom scheme I think, I need a specific url that isn't a part of the web that is only part of this program's internals, and should only run code from here (making the request on a normal browser or CURL shouldn't do anything, and should fail).

Is there a way to not have to use a custom scheme but have that kind of environment.
sshuzaFulcrum
Techie
 
Posts: 12
Joined: Tue Sep 27, 2022 9:31 am

Re: Invalid message: VALIDATION_ERROR_DESERIALIZATION_FAILED

Postby sshuzaFulcrum » Thu Sep 29, 2022 1:34 pm

magreenblatt wrote:The general advice here is not to use a custom scheme. See the bold text at https://bitbucket.org/chromiumembedded/ ... t-handling


I was able to recreate my test project in CEFSharp.WPF and the custom scheme doesn't cause this issue with it closing and it works as intended however I cannot utilize CEFSharp or .NET for that matter due to my project constraints. Is there any ideas I could try in regards to trying to not get my render process to crash.
sshuzaFulcrum
Techie
 
Posts: 12
Joined: Tue Sep 27, 2022 9:31 am

Re: Invalid message: VALIDATION_ERROR_DESERIALIZATION_FAILED

Postby magreenblatt » Thu Sep 29, 2022 1:54 pm

Is CefSharp at the same version? If so, you’re probably configuring something wrong.

The common solutions around such as ensuring that AddCustomScheme is done on every process, the scheme is standard, etc. I have already done and have not fixed the issue.

Show your code.

I need a specific url that isn't a part of the web that is only part of this program's internals, and should only run code from here (making the request on a normal browser or CURL shouldn't do anything, and should fail).

You can use an HTTP/HTTPS URL that doesn’t exist outside of your application.
magreenblatt
Site Admin
 
Posts: 12402
Joined: Fri May 29, 2009 6:57 pm

Re: Invalid message: VALIDATION_ERROR_DESERIALIZATION_FAILED

Postby sshuzaFulcrum » Thu Sep 29, 2022 2:31 pm

Show your code.


I used the cefsimple project from https://github.com/chromiumembedded/cef-project as my source of my project.

In wWinMain I added a switch case that goes between 2 possible process types:

Image

In SimpleApp (extends CefApp and CefBrowserProcessHandler)

I add the scheme with variables (the scheme itself and the options) that are defined elsewhere in a namespace that is accessible to SubProcessApp as well (I can't show the name due to it referring to stuff in NDA, sorry about that)

Image

In SubProcessApp (extends only CefApp)

Same here as well

Image

In SimpleApp I register my scheme handler Factory in OnContextInitialized (I am not sure if I have to do this in SubProcessApp, but I assume I don't).

Image

Here I specify my custom scheme and domain
Image

My Scheme, domain, and options are in the same namespace as RegisterSchemeHandlerFactory and are defined as follows:
Image

As you can see, I do have my options set to be standard, and these options are being inserted on every process and is a part of this SchemeHandler that is registered, considering that my print in my JavaScript works as intended, I assume this works fine.

You can use an HTTP/HTTPS URL that doesn’t exist outside of your application.


Is there a way I can confirm that there is no way that the domain can be registered on the public internet, I need to ensure it truly is inside the program and not available anywhere else.
sshuzaFulcrum
Techie
 
Posts: 12
Joined: Tue Sep 27, 2022 9:31 am

Re: Invalid message: VALIDATION_ERROR_DESERIALIZATION_FAILED

Postby magreenblatt » Thu Sep 29, 2022 2:46 pm

Both SimpleApp and SubProcessApp implement OnRegisterCustomSchemes? Are you passing the SubProcessApp instance to CefExecuteProcess?

Is there a way I can confirm that there is no way that the domain can be registered on the public internet, I need to ensure it truly is inside the program and not available anywhere else

Sure, use a non-existing subdomain of a domain that you control. Or if the domain name doesn’t matter use something like “myapp.example.com”
magreenblatt
Site Admin
 
Posts: 12402
Joined: Fri May 29, 2009 6:57 pm

Re: Invalid message: VALIDATION_ERROR_DESERIALIZATION_FAILED

Postby sshuzaFulcrum » Thu Sep 29, 2022 3:57 pm

Both SimpleApp and SubProcessApp implement OnRegisterCustomSchemes?


Yes
Image
Image

Are you passing the SubProcessApp instance to CefExecuteProcess?


Yes I am

Image

Sure, use a non-existing subdomain of a domain that you control. Or if the domain name doesn’t matter use something like “myapp.example.com”


Hmm ok, I will keep this mind, and see if this is a viable option for me. The thing is that this program might be targeted for security intrusions in the future (as it is further developed), so if it really attempts to do a domain name request to a real http location (let's say the resource handler factory didn't work), it could be a point of ingress by messing with the DNS behavior of the system (changing the cache in the OS, or changing router settings), thus I am trying to get CEF to just go to a place that cannot exist by the nature of the request itself (a custom scheme/protocol, and a custom domain cannot exist either).

I appreciate your suggestion, however, I am really in need of getting this custom scheme to run properly.
sshuzaFulcrum
Techie
 
Posts: 12
Joined: Tue Sep 27, 2022 9:31 am


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot], salvadordf and 41 guests