mirror of
https://github.com/floccusaddon/floccus.git
synced 2026-04-25 22:26:06 +03:00
[GH-ISSUE #1697] Unescaped HTML tag <script> in bookmark title names #1128
Labels
No labels
browser-specific
bug
correctness issues
enhancement
feature: Google Drive
feature: Linkwarden
feature: git
feature: nextcloud-bookmarks
feature: tabs
feature: webdav
help wanted
native-app
priority: high
priority: low
priority: medium
pull-request
question
question
stale
upstream
waiting for more information
wontfix
🙁 Not following issue template
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/floccus#1128
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @serious-angel on GitHub (Aug 17, 2024).
Original GitHub issue: https://github.com/floccusaddon/floccus/issues/1697
Which version of floccus are you using?
5.2.6
How many bookmarks do you have, roughly?
20k
Are you using other means to sync bookmarks in parallel to floccus?
No
Sync method
WebDAV
Which browser are you using? In case you are using the phone App, specify the Android or iOS version and device please.
Google Chrome, 127.0.6533.120 (Official Build) (64-bit)
Which version of Nextcloud Bookmarks are you using? (if relevant)
No response
Which version of Nextcloud? (if relevant)
No response
What kind of WebDAV server are you using? (if relevant)
RClone WebDav (built-in server).
Describe the Bug
Sincere appreciation for the project! Thank you! ✨
When tried syncing bookmarks with the following bookmark added, the whole set of bookmarks got missing in clients after manual import. A bookmark example with
<script>tag:Title:
HTML - <script> Tag - TutorialspointURL:
https://www.tutorialspoint.com/html/html_script_tag.htmExpected Behavior
Safe parsing of bookmarks data.
To Reproduce
Initial state of bookmarks
Push
The bookmarks file on WebDav remote:
Pull attempt
Pull ("fail-safe" disabled)
Push (2 time)
The bookmarks file on WebDav remote:
Pull (2 time; "fail-safe" disabled)
Imported the version from remote
Debug log provided
@github-actions[bot] commented on GitHub (Aug 17, 2024):
Hello 👋
Thank you for taking the time to open this issue with floccus. I know it's frustrating when software
causes problems. You have made the right choice to come here and open an issue to make sure your problem gets looked at
and if possible solved.
I'm Marcel and I created floccus and have been maintaining it ever since.
I currently work for Nextcloud which leaves me with less time for side projects like this one
than I used to have.
I still try to answer all issues and if possible fix all bugs here, but it sometimes takes a while until I get to it.
Until then, please be patient.
Note also that GitHub is a place where people meet to make software better together. Nobody here is under any obligation
to help you, solve your problems or deliver on any expectations or demands you may have, but if enough people come together we can
collaborate to make this software better. For everyone.
Thus, if you can, you could also have a look at other issues to see whether you can help other people with your knowledge
and experience. If you have coding experience it would also be awesome if you could step up to dive into the code and
try to fix the odd bug yourself. Everyone will be thankful for extra helping hands!
One last word: If you feel, at any point, like you need to vent, this is not the place for it; you can go to the forum,
to twitter or somewhere else. But this is a technical issue tracker, so please make sure to
focus on the tech and keep your opinions to yourself.
I look forward to working with you on this issue
Cheers 💙
@serious-angel commented on GitHub (Aug 17, 2024):
It seems like parsing and both DOM processing is based on custom text manipulation instead of actual DOM processing (e.g.
document.createElement) considering:github.com/floccusaddon/floccus@8161425cfd/src/lib/serializers/Html.ts (L10-L17)Since it should be supported by other utilities, encoding data like bookmark titles with Base64 is probably not an option. Yet, have you considering an actual DOM processing with more safe features, including textContent?:
@marcelklehr commented on GitHub (Aug 18, 2024):
Hey @artshade
The thing is that we cannot make use of DOM methods, because floccus sync happens in a service worker...
@serious-angel commented on GitHub (Aug 18, 2024):
Just to clarify, have you tried alternatives like
jsdom?Please check out a quick Node experiment at StackBlitz, which currently results in:
Service worker possible example
@marcelklehr commented on GitHub (Aug 18, 2024):
I've been actively trying to avoid JSDOM because it's huge. Additionally, the bookmarks html spec does not accept just any html with the right elements, but a very specific subset of HTML that is best hand-crafted, IMO. You can try generating a html file with document.createElement and importing it into a browser: Firefox at least will only take over the folder hierarchy if it has a certain format.
@serious-angel commented on GitHub (Aug 18, 2024):
It's huge for a reason to someone to not shoot their foot.
@marcelklehr commented on GitHub (Aug 18, 2024):
I'm not using regular expressions to parse HTML. I'm using a parser.
@serious-angel commented on GitHub (Aug 18, 2024):
s/parser/"parser"/@marcelklehr commented on GitHub (Aug 18, 2024):
I'm not inclined to continue this conversation unless you are committing to constructive communication. Please refrain from making snark remarks. If you have something to say, say it outright.
@marcelklehr commented on GitHub (Aug 18, 2024):
Concretely, referring back to your example:
This may be valid html, but it's not a valid bookmarks file. Firefox for example, will fall back to just importing the links without any hierarchy.
@serious-angel commented on GitHub (Aug 18, 2024):
Considering both the initial bot message and this response, you seem to be more focused on flattery and conversations rather than anything constructive indeed.
No one made any "snark remarks" but higlighted possible nonsense in ego-less manner.
I am sorry if I did tell anything wrong also investing time into the experiment, source code research of this project, and some additional researches. Sure, I won't respond you anymore, since I am not sure you receive the communication fairly enough. Please stay safe, @marcelklehr , and hopefully you will find peace in communicating with people around the globe and consider their invested time, too, indeed.
We all are developers, I believe. Developers try to improve the world as much as possible however they can, don't they?
@marcelklehr commented on GitHub (Aug 18, 2024):
Then let's be constructive: Why is floccus currently using a "parser" instead of a parser to parse the bookmarks format?
@github-actions[bot] commented on GitHub (Aug 19, 2025):
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.