Skip to content
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

AvCliper - Security Issue #257

Closed
Tsumiki opened this issue Aug 19, 2024 · 9 comments
Closed

AvCliper - Security Issue #257

Tsumiki opened this issue Aug 19, 2024 · 9 comments

Comments

@Tsumiki
Copy link

Tsumiki commented Aug 19, 2024

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

@hughfenghen
Copy link
Member

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

@Tsumiki
Copy link
Author

Tsumiki commented Aug 20, 2024

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.

@hughfenghen
Copy link
Member

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?

@Tsumiki
Copy link
Author

Tsumiki commented Aug 20, 2024

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.

@hughfenghen
Copy link
Member

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.

@Tsumiki
Copy link
Author

Tsumiki commented Aug 21, 2024

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.

@hughfenghen
Copy link
Member

image
Please use an HTTPS video resource for testing.

@Tsumiki
Copy link
Author

Tsumiki commented Aug 21, 2024

Good catch.

Amended demo: stackblitz

@hughfenghen
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants