linuxmint / linuxmint/cinnamon

UNSAFE_ITEMS are still being used in Cinnamon

Open
#11,621 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

New
Dominant language
JavaScript
Stars
5.6k
Forks
915
Avg merge
5d 22h
Merged PRs (30d)
3

Description

 * Cinnamon 5.6.8
   - Using the daily builds PPA: No
 * Distribution: Mint 21.1
 * Graphics hardware *and* driver used: no matters
 * 64 bit
Issue

In /usr/share/cinnamon/cinnamon-settings/bin/ExtensionCore.py there is the line 32:
UNSAFE_ITEMS = ['spawn_sync', 'spawn_command_line_sync', 'GTop', 'get_file_contents_utf8_sync']

If a spice uses one of these UNSAFE_ITEMS, it is flagged as 'Dangerous'.

So why are these UNSAFE_ITEMS still being used by Cinnamon?

Steps to reproduce
  • apt install silversearcher-ag
  • cd /usr/share/cinnamon/
  • ag get_file_contents_utf8_sync

Output:

js/ui/search.js
309:        let source = Cinnamon.get_file_contents_utf8_sync(path);

js/ui/main.js
287:            let content = Cinnamon.get_file_contents_utf8_sync("/proc/cmdline");

js/ui/settings.js
646:        let templateString = Cinnamon.get_file_contents_utf8_sync(templateFile.get_path());
650:            overrideString = Cinnamon.get_file_contents_utf8_sync(overrideFile.get_path());
838:        let rawData = Cinnamon.get_file_contents_utf8_sync(this.file.get_path());

js/ui/placesManager.js
519:        let bookmarksContent = Cinnamon.get_file_contents_utf8_sync(this._bookmarksPath);

cinnamon-settings/bin/ExtensionCore.py
32:UNSAFE_ITEMS = ['spawn_sync', 'spawn_command_line_sync', 'GTop', 'get_file_contents_utf8_sync']
Expected behaviour

That Cinnamon avoid using these UNSAFE_ITEMS.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with cinnamon-settings/bin/ExtensionCore.py and the occurrences found by the reported ag get_file_contents_utf8_sync search in js/ui/search.js, main.js, settings.js, and placesManager.js. Review how these UNSAFE_ITEMS are classified and used, then verify that Cinnamon no longer uses the listed unsafe APIs and that the reported search produces no remaining occurrences.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, python
Domain
desktop, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.