<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>16141</bug_id>
          
          <creation_ts>2026-01-16 15:10:50 +0000</creation_ts>
          <short_desc>Adding `GITHUB_TOKEN` to `FETCH_EXPORT_VARS` potentially exposes tokens in plaintext</short_desc>
          <delta_ts>2026-05-28 13:16:29 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>BitBake</product>
          <component>bitbake</component>
          <version>5.0.14</version>
          <rep_platform>All</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>6.1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Jens">jnsk</reporter>
          <assigned_to name="Unassigned">unassigned</assigned_to>
          <cc>ccasciato</cc>
    
    <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>randy.macleod</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Don&apos;t know</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>103948</commentid>
    <comment_count>0</comment_count>
    <who name="Jens">jnsk</who>
    <bug_when>2026-01-16 15:10:50 +0000</bug_when>
    <thetext>Concerning this commit:
https://git.enea.com/cgit/linux/poky.git/commit/bitbake/lib/bb/fetch2/__init__.py?id=aa546ea0c316116d1f6f34f729a9e23f24322e0e

It adds `GITHUB_TOKEN` to the `FETCH_EXPORT_VARS`, a list of env vars that get reintroduced to the sanitized environments that bitbake uses while fetching etc. The export vars and their plaintext values then become part of the command line, which may end up in public build logs.

Please have another look at this commit; maybe it&apos;s expected behavior and fine, but I wanted to alert the maintainers to this potential issue just to be sure.

Jens</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104020</commentid>
    <comment_count>1</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2026-01-22 15:39:03 +0000</bug_when>
    <thetext>Paul put this on our security documentation task list.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104052</commentid>
    <comment_count>2</comment_count>
    <who name="Paul Barker">paul</who>
    <bug_when>2026-01-23 11:03:54 +0000</bug_when>
    <thetext>We should document this in the &quot;Security Manual&quot; section of our documentation.

We don&apos;t want to remove `GITHUB_TOKEN` from the exported vars as that prevents users from using the token to fetch repositories in the context of GitHub Codespaces / GitHub Actions.

If you&apos;re publishing build logs, you should always do some filtering/checking to make sure you&apos;re not leaking secrets. In the case of GitHub Actions, secret values should already be filtered out of the logs (https://docs.github.com/en/actions/concepts/security/secrets#automatically-redacted-secrets).

In GitHub Codespaces or local development environments, you could just run `echo $GITHUB_TOKEN` to print the value, so I don&apos;t think we&apos;re reducing the protection of the secret value by allowing it to be present in our logs.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104058</commentid>
    <comment_count>3</comment_count>
    <who name="Jens">jnsk</who>
    <bug_when>2026-01-23 13:49:12 +0000</bug_when>
    <thetext>FWIW: We&apos;re currently using the [~/.git-credentials](https://git-scm.com/docs/git-credential-store#_storage_format) file as a workaround. That is not an ideal solution either, but at least it&apos;s not visible outside of the build container.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104060</commentid>
    <comment_count>4</comment_count>
    <who name="Jens">jnsk</who>
    <bug_when>2026-01-23 14:01:55 +0000</bug_when>
    <thetext>(In reply to Paul Barker from comment #2)
&gt; If you&apos;re publishing build logs, you should always do some
&gt; filtering/checking to make sure you&apos;re not leaking secrets.

I strongly disagree with this inversion of responsibility. Especially from a DevOps perspective most people wouldn&apos;t even know what secrets to look out for. Build logs are also commonly used to communicate with external partners and support. They are sometimes part of sealed certification packages and should not be tampered with as part of regular operations, IMO.

If GH isn&apos;t planning on providing a better mechanism soon, I&apos;d suggest to implement the redaction feature as part of bitbake&apos;s logging.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105609</commentid>
    <comment_count>5</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2026-05-28 13:16:29 +0000</bug_when>
    <thetext>Bulk move of 6.0 Medium bugs to 6.1.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>