<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" 
  xmlns:content="http://purl.org/rss/1.0/modules/content/" 
  xmlns:dc="http://purl.org/dc/elements/1.1/" 
  xmlns:atom="http://www.w3.org/2005/Atom" 
  xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" 
  xmlns:media="http://search.yahoo.com/mrss/">
  <channel>
    <title>secrets on Solid Soft</title>
    <link>https://blog.solidsoft.pl/tags/secrets/</link>
    <description>Recent content in secrets on Solid Soft</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <copyright>©{year}, All Rights Reserved</copyright>
    <lastBuildDate>Tue, 28 Jun 2022 22:00:00 +0200</lastBuildDate>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>2</sy:updateFrequency>
    
        <atom:link href="https://blog.solidsoft.pl/tags/secrets/index.xml" rel="self" type="application/rss+xml" />
    
    
    

      
      <item>
        <title>Security issue in Parcellite &lt;= 1.2.1</title>
        <link>https://blog.solidsoft.pl/2022/06/28/security-issue-in-parcellite-1.2.1/</link>
        <pubDate>Tue, 28 Jun 2022 22:00:00 +0200</pubDate>
        
        <atom:modified>Sun, 21 May 2023 22:22:00 +0200</atom:modified>
        <guid>https://blog.solidsoft.pl/2022/06/28/security-issue-in-parcellite-1.2.1/</guid>
        <description>Parcellite clipboard manager might cause your copied secrets to be stored in the plain-text form in the system logs.
  
TL;TR. Parcellite might cause your copied secrets to be stored in the plain-text form in the system logs. To check if your system is affected jump to the &amp;ldquo;appropriate&amp;rdquo; section below. Background I am an avid user of clipboard managers. In fact, I cannot image how I could stop using that feature (and how can people live without it ;-) ).</description>
        <content:encoded>&lt;blockquote&gt;
&lt;p&gt;Parcellite clipboard manager might cause your copied secrets to be stored in the plain-text form in the system logs.&lt;/p&gt;
&lt;/blockquote&gt;


&lt;figure &gt;
  
    &lt;img src=&#34;https://blog.solidsoft.pl/images/posts/2022/parcellite-plain-text-issues.jpg&#34;  style=&#34;width:;height:;&#34;/&gt;
  
  
&lt;/figure&gt;

&lt;p&gt;&lt;br /&gt;&lt;br /&gt;
&lt;div class=&#34;alert alert-info&#34; role=&#34;alert&#34; data-dir=&#34;ltr&#34;&gt;&lt;strong&gt;TL;TR&lt;/strong&gt;. Parcellite might cause your copied secrets to be stored in the plain-text form in the system logs. To check if your system is affected jump to the &lt;a href=&#34;#affected-systemsusers&#34;&gt;&amp;ldquo;appropriate&amp;rdquo;&lt;/a&gt; section below.&lt;/div&gt;
&lt;/p&gt;
&lt;h2 id=&#34;background&#34;&gt;Background&lt;/h2&gt;
&lt;p&gt;I am an avid user of clipboard managers. In fact, I cannot image how I could stop using that feature (and how can people live without it ;-) ). An ability to be able to refer to the previously copied text entries is a productivity booster in many cases. Unfortunately, modern Linux desktop environments complicate the thing (precisely Wayland - a &amp;ldquo;new&amp;rdquo; display server protocol), ironically, due to the security concerns, not providing any sensible alternative.&lt;/p&gt;
&lt;p&gt;Some time ago, I was experimenting with some alternative clipboard managers. Parcellite was one of them and I have discovered not a very pleasant behavior.&lt;/p&gt;
&lt;h2 id=&#34;vulnerability&#34;&gt;Vulnerability&lt;/h2&gt;
&lt;p&gt;parcellite 1.2.1 on Fedora (tested with F34 and &lt;code&gt;parcellite-1.2.1-6.fc34.x86_64&lt;/code&gt;) is by default automatically started using a &lt;code&gt;.desktop&lt;/code&gt; file. That result in having it caught by the journal systemd daemon and the output (stdout and stderr) is in a default configuration kept in the journal files. It can be:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;hellip; parcellite-startup.desktop[5354]: xdotool:&#39;/bin/sh -c &amp;lsquo;xdotool mousedown 2 &amp;amp;&amp;amp; xdotool mouseup 2&amp;rsquo;&amp;rsquo;&lt;br /&gt;
&amp;hellip; foobar parcellite-startup.desktop[5354]: text:&amp;lsquo;xxx&amp;rsquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;where &lt;code&gt;&#39;xxx&#39;&lt;/code&gt; can be anything copied by an user, including user&amp;rsquo;s passwords and API keys. The entries are user accessible (via journalctl), so every (potentially&lt;br /&gt;
malicious) application could read it. The old journal files - depending on the system configuration - can be kept for months (or longer), so systems with an unencrypted hard disc provide also an alternative vector of attack.&lt;/p&gt;
&lt;p&gt;The output is generated in &lt;a href=&#34;https://github.com/rickyrockrat/parcellite/blob/6da1c72db775b47174da9f3d516c6b5b9b40786a/src/main.c#L1698&#34; target=&#34;_blank&#34;&gt;that place&lt;/a&gt;
:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;cmd = g_strconcat(&amp;quot;/bin/sh -c &#39;xdotool &amp;quot;, action, NULL);
g_fprintf(stderr,&amp;quot;xdotool:&#39;%s&#39;\ntext:&#39;%s&#39;\n&amp;quot;,cmd,txt);
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;which was added as an enhanced debug statement back &lt;a href=&#34;https://github.com/rickyrockrat/parcellite/commit/40ac970ba74775e83b276d4f4a5eb3d546b9dd36&#34; target=&#34;_blank&#34;&gt;in 2013&lt;/a&gt;
. This suggests that versions 1.1.7 to 1.2.1 can be affected.&lt;/p&gt;
&lt;p&gt;That behavior does not require persisting clipboard entries across system restarts (which generates similar security risk and is disabled by default).&lt;/p&gt;
&lt;p&gt;As the aforementioned &lt;code&gt;.desktop&lt;/code&gt; file is provided by the upstream project, the other Linux distributions using it to automatically start Parcellite on user log in most likely are also affected.&lt;/p&gt;
&lt;h2 id=&#34;fix&#34;&gt;Fix&lt;/h2&gt;
&lt;p&gt;Upgrade to 1.2.2 (once released) or to the &lt;a href=&#34;https://github.com/rickyrockrat/parcellite/commit/7b8b5d2b0ac434493916e46dedfbd3d6d62bb8b4&#34; target=&#34;_blank&#34;&gt;patched versions&lt;/a&gt;
 of 1.2.1 if available in your distribution repository.&lt;/p&gt;
&lt;p&gt;As a workaround, disable auto start for Parcellite using the &lt;code&gt;.desktop&lt;/code&gt; file and run it manually.&lt;/p&gt;
&lt;h2 id=&#34;affected-systemsusers&#34;&gt;Affected systems/users&lt;/h2&gt;
&lt;p&gt;The issue can only affect &lt;strong&gt;desktop users&lt;/strong&gt; using &lt;strong&gt;Parcellite 1.1.7 to 1.2.1&lt;/strong&gt; (1.2.2 with the fix is not yet released at the time of publishing that advisory) on &lt;strong&gt;X.Org Server&lt;/strong&gt; (Parcellite does not work with Wayland).&lt;/p&gt;
&lt;p&gt;The problem was originally reproduced with Fedora 34 (the newest version at the time of discovery), but probably &lt;strong&gt;the majority of other distros using systemd with the modern journal&lt;/strong&gt; are also affected. Please let me know (via mail or in comments) if your distro is affected and I will update that section.&lt;/p&gt;
&lt;p&gt;If unsure, copy some text into clipboard and check &lt;code&gt;journalctl -u parcellite-startup.desktop&lt;/code&gt; for the copied value. If found, the system is affected.&lt;/p&gt;
&lt;div class=&#34;alert alert-info&#34; role=&#34;alert&#34; data-dir=&#34;ltr&#34;&gt;&lt;strong&gt;This vulnerability is NOT (easily) exploitable from the internet&lt;/strong&gt;. A successful attack requires &lt;strong&gt;live access to the system with a (current) user permissions&lt;/strong&gt; (e.g. any application running by that users) &lt;strong&gt;or offline access to an unencrypted disk/storage with the system logs&lt;/strong&gt;.&lt;/div&gt;

&lt;h2 id=&#34;dealing-with-potentially-compromised-credentials&#34;&gt;Dealing with (potentially) compromised credentials&lt;/h2&gt;
&lt;p&gt;It is best to roll/change all the credentials (and other secret) copied into a clipboard when Parcellite was running. The &lt;code&gt;journalctl -u -ball parcellite-startup.desktop&lt;/code&gt; command might be useful.&lt;/p&gt;
&lt;p&gt;If changing the secrets is problematic or not possible (e.g. your SSN or your credit card number), it is possible to:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;remove the affected journal files&lt;/li&gt;
&lt;li&gt;rewrite the history in the affected journal files (which is not easy, but is &lt;a href=&#34;https://unix.stackexchange.com/a/616732&#34; target=&#34;_blank&#34;&gt;possible&lt;/a&gt;
)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;timeline&#34;&gt;Timeline&lt;/h2&gt;
&lt;p&gt;A legend: TPM - the Parcellite maintainer.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;20210919 - me - an initial email to TPM&lt;/li&gt;
&lt;li&gt;20210921 - me - another email to TPM&lt;/li&gt;
&lt;li&gt;20210927 - TPM - a response suggesting to create a regular GitHub issue&lt;/li&gt;
&lt;li&gt;20210927 - me - information to TPM what the issue is and how could be fixed + a suggestion to create a security advisory using GitHub&lt;/li&gt;
&lt;li&gt;20211005 - TPM - the issue &lt;a href=&#34;https://github.com/rickyrockrat/parcellite/commit/7b8b5d2b0ac434493916e46dedfbd3d6d62bb8b4&#34; target=&#34;_blank&#34;&gt;fixed in master&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;20211011 - me - a question to TPM about the new version&lt;/li&gt;
&lt;li&gt;20211020 - me - another question to TPM&lt;/li&gt;
&lt;li&gt;20211028 - me - yet another question to TPM&lt;/li&gt;
&lt;li&gt;20220626 - me - information to TPM about my intention to reveal the issue anyway (as the new version is not yet released after 9 months)&lt;/li&gt;
&lt;li&gt;20220628 - me - release the vulnerability description on &lt;a href=&#34;https://blog.solidsoft.pl/2022/06/28/security-issue-in-parcellite-1.2.1/&#34; target=&#34;_blank&#34;&gt;my blog&lt;/a&gt;
 and in the &lt;a href=&#34;https://github.com/rickyrockrat/parcellite/issues/79&#34; target=&#34;_blank&#34;&gt;public issue on GitHub&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;20230311 - TPM - release Parcellite 1.2.2, containing the fix&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;further-actions&#34;&gt;Further actions&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;del&gt;Convince the Parcellite author to finally release 1.2.2.&lt;/del&gt;&lt;/li&gt;
&lt;li&gt;&lt;del&gt;Notify the package maintainers to upgrade the version (or apply a &lt;a href=&#34;https://github.com/rickyrockrat/parcellite/commit/7b8b5d2b0ac434493916e46dedfbd3d6d62bb8b4&#34; target=&#34;_blank&#34;&gt;patch&lt;/a&gt;
)&lt;/del&gt;&lt;/li&gt;
&lt;li&gt;Request for the CVE number - it would be good to be obtained by the project author, possibly using the mechanism provided by &lt;a href=&#34;https://docs.github.com/en/code-security/security-advisories/about-github-security-advisories&#34; target=&#34;_blank&#34;&gt;GitHub&lt;/a&gt;
 - UPDATED. I was unable to get one :-(.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Updated 2020-05-21&lt;/strong&gt;. Mention recent Parcellite 1.2.2 release, rename TPA to TPM + update the &amp;ldquo;further actions&amp;rdquo;.&lt;/p&gt;
&lt;h2 id=&#34;summary&#34;&gt;Summary&lt;/h2&gt;
&lt;p&gt;I am just an off-the-clock security researcher, but having some (potentially) security-related problems (accidentally) spotted, I like to have it reported and fixed to do not expose other people and systems at risk. Thanks to my previous findings the users of (among others) &lt;a href=&#34;https://blog.travis-ci.com/2016-11-23-security-vulnerability-environment-variables/&#34; target=&#34;_blank&#34;&gt;Travis&lt;/a&gt;
 and &lt;a href=&#34;https://blog.solidsoft.pl/2020/06/03/simpler-and-safer-artifact-signing-on-ci-server-with-gradle/&#34;&gt;Gradle&lt;/a&gt;
 can sleep (slightly more) peacefully :-).&lt;/p&gt;
&lt;span style=&#34;opacity: 0.6&#34;&gt;Lead photo by &lt;a href=&#34;https://pixabay.com/users/tsmr-5239693/&#34;&gt;tsmr&lt;/a&gt;, published in &lt;a href=&#34;https://pixabay.com/illustrations/password-computer-protection-2271736/&#34;&gt;Pixabay&lt;/a&gt;, Pixabay License.&lt;/span&gt;
</content:encoded>
        <dc:creator>Marcin Zajączkowski</dc:creator>
        <media:content url="https://blog.solidsoft.pl/images/posts/2022/parcellite-plain-text-issues-thumbnail.jpg" medium="image"><media:title type="html">featured image</media:title></media:content>
        
        <media:content url="https://blog.solidsoft.pl/images/posts/2022/parcellite-plain-text-issues-ratio.jpg" medium="image"><media:title type="html">meta image</media:title></media:content>
        
          
            
              <category>parcellite</category>
            
          
            
              <category>security</category>
            
          
            
              <category>vulnerability</category>
            
          
            
              <category>plain-text</category>
            
          
            
              <category>secrets</category>
            
          
        
        
          
            
              <category>Other</category>
            
          
        
        
      </item>
      

    
  </channel>
</rss>