Bug 410471

Summary: Clipboard applet fails to load in Plasma (and effectively freezes Plasma) when history contains large Javascript
Product: [Unmaintained] klipper Reporter: Daniel Duris <kdebugs>
Component: plasma-widgetAssignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED DUPLICATE    
Severity: grave CC: kde, nate
Priority: NOR    
Version: 5.12.8   
Target Milestone: ---   
Platform: Kubuntu   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Daniel Duris 2019-07-31 20:22:36 UTC
SUMMARY


STEPS TO REPRODUCE
1. Copy huge Javascript into Clipboard applet
2. Kill plasmashell and reload
3. PLasma effectively freezes and won't load, CPU will be on 99+% forever

OBSERVED RESULT
Plasma stuck

EXPECTED RESULT
Plasma loading

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Once clipboard history file (.lst) is deleted via command line, everything works as expected
Comment 1 Daniel Duris 2019-07-31 20:23:27 UTC
This also could be a security issue, but I am not sure, if JS code gets executed or not or why the freeze otherwise happens.
Comment 2 Kai Uwe Broulik 2019-08-01 06:43:11 UTC
How large is that file? I tried with a 7000+ 300 kiB C++ file and cannot reproduce.
Comment 3 Daniel Duris 2019-08-01 08:54:29 UTC
You can download the file here (1.34 MB minified):
https://www.dpdmojkurier.sk/static/js/main.5cfe4e5d.js

CTRL+C

Go to this JS beautifier:
https://beautifier.io/

CTRL+V, beautify, CTRL+C

Now try to open Clipboard to see the history, whole plasma just freezes.

Once I delete the history file:
rm ~/.local/share/klipper/history2.lst

And kill and restart plasma, everything is fine.
Comment 4 Nate Graham 2021-04-01 20:23:36 UTC

*** This bug has been marked as a duplicate of bug 360262 ***