bilibili/WebAV

AvCliper - Security Issue

Closed this issue · 9 comments

Hi,

I recently upgraded to the latest av-cliper (from [0.13.6] - [0.14.14]) and am not getting a security error that I wasn't previously getting:
image

This seems to be happening when calling init on the log.ts. Not sure what's breaking this for me, I'm using the MP4Clip pretty much the same as described in your documents:

     const resp1 = await fetch(src);
     const videoClip = new MP4Clip(resp1.body);
     await videoClip.ready; 
     return videoClip;

But it seems to be throwing on the ready.

For reference I'm using the dist of av-clipper.js in an MVC environment hosted with IIS. Given the updates you've made since [0.13.6] I'd be keen to get this later version working so any ideas/suggestions would be most helpful.

Thanks

I found a similar issue; you might want to try it out to see if it solves your problem.
https://stackoverflow.com/questions/70811129/securityerror-failed-to-read-the-localstorage-property-from-window-access

I did try this, had a good look around before reaching out to you, the library writes to local storage fine on the older version, but from [0.13.10] onwards it just stops working, I can't really see any massive differences in the code that is calling into opfs, so it could be something odd in the dependency.

WebAV v0.13.10 has been updated to depend on opfs-tools v0.5.8, and opfs-tools has been upgraded to rely on vite v5.3.4. The corresponding PR for vite can be found here: vite#17509.

The purpose of these upgrades is to resolve the issue where av-cliper couldn't run in a Worker.

Could you provide a reproducible demo?

Sure, a very very simple reproduction is here, stackblitz-demo.

All this is doing is loading an MP4Clip and adding it to a map to be accessed for decoding later, I could expand this if required but the exception does appear here.

It seems to be failing inside the worker, it is possible that this is only an issue in a vanilla JS world and in react this might not happen but the project I'm working on is deeply rooted in .NET MVC (classic might I add...) that I'm limited in regartds to chaning this.

I couldn't reproduce the security error in the demo.

but the project I'm working on is deeply rooted in .NET MVC

It might be a limitation of the JavaScript runtime environment, rather than a bug in WebAV or opfs-tools.

That's strange as I'm seeing it clearly in the demo, in both chrome and edge I might add, so nothing to to with browser or cookies:
image

This should also rule out the environmental issues as well.

image
Please use an HTTPS video resource for testing.

Good catch.

Amended demo: stackblitz

The screenshot indicates that the video file was successfully parsed.
image

I am unable to reproduce the reported error. This issue will be suspended for a period of time, and if no other reports are received, it will be closed.