<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>Quarkslab's blog - scala</title><link href="http://blog.quarkslab.com/" rel="alternate"></link><link href="http://blog.quarkslab.com/feeds/scala.rss.xml" rel="self"></link><id>http://blog.quarkslab.com/</id><updated>2026-06-01T00:00:00+02:00</updated><entry><title>Scala Security Audit</title><link href="http://blog.quarkslab.com/scala-security-audit.html" rel="alternate"></link><published>2026-06-01T00:00:00+02:00</published><updated>2026-06-01T00:00:00+02:00</updated><author><name>Sébastien Rolland</name></author><id>tag:blog.quarkslab.com,2026-06-01:/scala-security-audit.html</id><summary type="html">&lt;p&gt;The Scala team has partnered with the &lt;a href="https://ostif.org/"&gt;Open Source Technology Improvement Fund&lt;/a&gt; (OSTIF) to conduct its first security audit. This initiative aims to identify potential vulnerabilities through static and dynamic analysis and provide greater confidence in Scala. The security audit conducted by Quarkslab is particularly focused on &lt;em&gt;&lt;a href="https://github.com/scala/scala3"&gt;Scala 3&lt;/a&gt;&lt;/em&gt;.&lt;/p&gt;</summary><content type="html">&lt;h1 id="introduction"&gt;Introduction&lt;/h1&gt;
&lt;p&gt;&lt;a href="https://docs.scala-lang.org/"&gt;Scala&lt;/a&gt; is a modern multi-paradigm programming language designed to express common programming patterns in a concise, elegant, and type-safe way. It seamlessly integrates features of object-oriented and functional languages.
Over the years, Scala has evolved through several major iterations, with &lt;em&gt;Scala 2&lt;/em&gt; and &lt;em&gt;Scala 3&lt;/em&gt; representing the most significant major versions to date.
&lt;em&gt;Scala 3&lt;/em&gt; introduces a modernized syntax, a more consistent type system, and a new compiler. These improvements aim to simplify the language, make code easier to read and maintain, while remaining broadly compatible with existing &lt;em&gt;Scala 2&lt;/em&gt; code. The security audit is particularly focused on &lt;em&gt;Scala 3&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;The audit started with a discovery phase in which auditors examined the Scala documentation and source code to understand the project, its security guarantees, and defined the audit scope by designing a threat model. As a second step, a detailed manual code review was conducted to detect vulnerabilities, focusing first on the critical functionalities identified in the threat model. In parallel, automated static analysis tools such as Gadget Inspector and Opengrep were used to scan the codebase for potential security issues. 
Finally, the auditors performed dynamic testing using fuzzing techniques on the most critical components of the Scala standard library and provided recommendations to address the vulnerabilities found.&lt;/p&gt;
&lt;h1 id="scope"&gt;Scope&lt;/h1&gt;
&lt;p&gt;The audit focused on the core components of the Scala ecosystem, including the &lt;em&gt;Scala 3&lt;/em&gt; compiler, its compilation pipeline, generated JVM bytecode, the Scala REPL, the TASTy Inspector, and the Scala documentation generator. 
The assessment also covered the Scala standard library, particularly collections, concurrency primitives and other utility modules. 
The threat model addressed two primary threat actors:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;malicious end users interacting with Scala applications through exposed interfaces;&lt;/li&gt;
&lt;li&gt;malicious developers or operators with privileged access to the source code or build process.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Giving the time frame allow, auditors have chosen to consider out of scope:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;vulnerabilities related to compiler mechanisms executing user-provided code;&lt;/li&gt;
&lt;li&gt;the Scala 2 compiler;&lt;/li&gt;
&lt;li&gt;separated standard library modules such as scala-xml or scala-swing;&lt;/li&gt;
&lt;li&gt;third-party dependencies;&lt;/li&gt;
&lt;li&gt;runtime environment security issues related to the JVM.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The full report of the assessment can be found on Quarkslab's &lt;a href="https://github.com/quarkslab/public-reports"&gt;public reports repository&lt;/a&gt;.&lt;/p&gt;
&lt;h1 id="findings"&gt;Findings&lt;/h1&gt;
&lt;p&gt;The table below summarizes the findings of the audit. A total of 9 vulnerabilities were identified: 5 of medium severity, 2 of low severity, and 2 informative issues.&lt;/p&gt;
&lt;table class="table table-striped"&gt;
&lt;thead&gt;
&lt;th&gt;ID&lt;/th&gt;
&lt;th&gt;Title&lt;/th&gt;
&lt;th&gt;Severity&lt;/th&gt;
&lt;th&gt;Perimeter&lt;/th&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;th class="no-wrap" scope="row"&gt;MEDIUM-1&lt;/th&gt;
&lt;td&gt;`scala.sys.Process.ProcessBuilderImpl` `AbstractFunction0` may be used as a deserialization gadget  &lt;/td&gt;
&lt;td&gt;Medium&lt;/td&gt;
&lt;td&gt;Scala 3.8-RC1 standard library&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;th class="no-wrap" scope="row"&gt;MEDIUM-6&lt;/th&gt;
&lt;td&gt; Stored XSS vulnerability in Scaladoc &lt;/td&gt;
&lt;td&gt;Medium&lt;/td&gt;
&lt;td&gt;Scala 3.8-RC1 Scaladoc&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;th class="no-wrap" scope="row"&gt;MEDIUM-7&lt;/th&gt;
&lt;td&gt;Unexpected return value in `scala.collection.SeqOps.indexOfSlice` on empty sequences &lt;/td&gt;
&lt;td&gt;Medium&lt;/td&gt;
&lt;td&gt;Scala 3.8-RC1 standard library&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;th class="no-wrap" scope="row"&gt;MEDIUM-8&lt;/th&gt;
&lt;td&gt;Uncaught `ParseException` in `scala.sys.process.Parser.tokenize` on unmatched quotes &lt;/td&gt;
&lt;td&gt;Medium&lt;/td&gt;
&lt;td&gt;Scala 3.8-RC1 standard library&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;th class="no-wrap" scope="row"&gt;MEDIUM-9&lt;/th&gt;
&lt;td&gt;Infinite loop during section loading in `dotty.tools.dotc.core.tasty.TastyUnpickler`&lt;/td&gt;
&lt;td&gt;Medium&lt;/td&gt;
&lt;td&gt;Scala 3.8-RC1 Dotty&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;th class="no-wrap" scope="row"&gt;LOW-2&lt;/th&gt;
&lt;td&gt;Potential command injection in GitHub Actions CI/CD scripts&lt;/td&gt;
&lt;td&gt;Low&lt;/td&gt;
&lt;td&gt;Scala 3.8-RC1 GitHub Actions Workflows&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;th class="no-wrap" scope="row"&gt;LOW-5&lt;/th&gt;
&lt;td&gt; Scala Java produced bytecode could lead to conflicts as the compiler doesn&amp;rsquo;t check for them between generated and user-defined methods&lt;/td&gt;
&lt;td&gt;Low&lt;/td&gt;
&lt;td&gt;Scala 3.8-RC1 Dotty&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;th class="no-wrap" scope="row"&gt;INFO-1&lt;/th&gt;
&lt;td&gt;Use of non-cryptographically secure random number generator&lt;/td&gt;
&lt;td&gt;Info&lt;/td&gt;
&lt;td&gt;Scala 3.8-RC1 Dotty compiler&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;th class="no-wrap" scope="row"&gt;INFO-4&lt;/th&gt;
&lt;td&gt;`TastyPrinter` silently skips `.tasty` files in subdirectories of a `.jar`&lt;/td&gt;
&lt;td&gt;Info&lt;/td&gt;
&lt;td&gt;Scala 3.8-RC1 *scala (-print-tasty)*&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h1 id="conclusion"&gt;Conclusion&lt;/h1&gt;
&lt;p&gt;Quarkslab identified several vulnerabilities and implementation bugs within the &lt;em&gt;Scala&lt;/em&gt; code base. Most of these issues require specific preconditions to exploit, but their presence still poses a security risk. At the same time, Quarkslab acknowledges the significant security
engineering efforts invested by the &lt;em&gt;Scala&lt;/em&gt; development team.
Alongside the vulnerability disclosures, Quarkslab provided actionable recommendations and mitigation strategies to address the identified issues. By addressing these findings, the &lt;em&gt;Scala&lt;/em&gt; maintainers have the opportunity to further improve the robustness of the project, ensuring greater resilience in production environments and strengthening the overall security posture of the &lt;em&gt;Scala&lt;/em&gt; ecosystem.&lt;/p&gt;
&lt;p&gt;We truly enjoyed collaborating with the OSTIF and we extend our sincere thanks to Scala's Maintenair for his availability, responsiveness, and the constructive discussions that made this collaboration so effective.&lt;/p&gt;
&lt;h1 id="further-reading"&gt;Further reading&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://ostif.org/scala-audit-complete"&gt;OSTIF blog post&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content><category term="Software"></category><category term="audit"></category><category term="OSTIF"></category><category term="software"></category><category term="scala"></category><category term="2026"></category></entry></feed>