Picnic-It

Malware Hid Inside a Popular Flutter Package: The pub.dev XCSSET Attack and What It Means for Your App

A package can be popular, useful and hosted on the official repository, and still arrive with a hidden risk. In September 2026, security researchers found XCSSET malware inside a version of a Flutter package on pub.dev. The incident is a useful reminder for any business building an app: keeping your code safe means looking after the people, devices and dependencies involved in making it.

What happened on pub.dev?

On 8 September, Aikido Security reported what it described as the first compromised package it had detected on pub.dev, the official repository for Dart and Flutter packages.

The package, universal_file_viewer, helps Flutter apps preview files such as PDFs, Word and Excel documents, videos and Markdown. The affected release was version 0.1.5, which had around 500 downloads.

The package’s maintainer had an infected Mac. When they published a new version, infected project files from that machine went along with it. Researchers found malicious code in the package’s example/ directory, which contains a sample application developers can try out.

The code was tucked into build configurations rather than the package’s main Dart library. An Android Gradle preBuild hook ran a concealed command during a build. The iOS and macOS Xcode projects contained build rules that could run while processing Markdown files. Obfuscation, the deliberate hiding or disguising of code, helped make the Android command harder to spot with simple string searches.

Wireframe project folder branching into Android, iOS and Git build paths, with a hidden cyan line passing through

The important distinction: using the package versus building its example

There’s a useful detail here, and it matters when assessing exposure. Aikido reported that the package’s lib/ Dart code was clean. Simply adding universal_file_viewer as a dependency and building your own app did not trigger the malicious code. The identified risk was to developers who cloned the repository and built its example app locally.

That makes this a narrower incident than a package whose main code executes for every user. But it is not harmless. XCSSET is a macOS worm, a type of malware designed to spread, and researchers describe it as able to plant malicious build hooks in Android Gradle projects, Xcode projects and Git repositories on an infected machine. It can also steal valuable information, including browser credentials and session data.

That wider capability changes the question from “Did our released app contain the malware?” to “Did anyone on our team build the infected example on a work device?”

A trusted package is still code from outside your organisation. The place you download it from is only one part of the trust decision.

Why should businesses building Flutter apps care?

The first lesson is that a developer’s machine is part of your attack surface. It may hold access to source code, cloud services, app-store accounts, password managers and business systems. If malware reaches that machine, the potential consequences can go well beyond one test build.

The second lesson is that a build is not always a passive process. Project files and build configurations can contain instructions that run when a developer builds an app. Reviewing the app’s Dart code alone won’t necessarily reveal every risk; native Android, iOS and macOS project files matter too.

And third, an official repository is not a guarantee that every published version is safe. Package registries are important tools, but packages can be affected by a compromised maintainer account or device. In this case, the published package acted as a carrier for infected example files; it was not evidence that every app using the library had been infected.

The incident also sits within a wider pattern. In 2026, npm saw Shai-Hulud worm activity involving packages including keyv and related libraries, as well as a compromised tensorlake package, as reported by JFrog and Aikido. These are different incidents and malware; they don’t mean the Flutter package was connected to those attacks. They do show that software supply chains (the packages, maintainers, tools and systems used to build software) are a recurring target.

XCSSET itself has also continued to evolve. Microsoft’s 2025 reporting described changes to its data theft and persistence techniques, while Unit 42’s July 2026 analysis documented a newer variant spreading through Xcode projects. The details change; the broad risk remains: an infected developer environment can turn trusted project files into a route for further compromise.

Connected developer laptop, open-source package, build pipeline and app, with a protective shield around the process

Practical steps to reduce the risk

This is not a reason to avoid Flutter or open-source packages. It is a reason to make dependency checks part of the normal development process.

  1. Check versions in use. Review pubspec.lock as well as pubspec.yaml to see which package versions are actually resolved in your app. If your team used this package, check whether version 0.1.5 was downloaded or whether anyone cloned and built its example. The pub.dev changelog records a later security update removing unauthorised Xcode build rules and script phases from the example iOS and macOS configurations.

  2. Pin and review dependencies. Use deliberate version constraints and commit your lockfile so builds use known versions. Before approving a dependency update, check its purpose, maintainer history and release changes. Avoid updating packages automatically without review.

  3. Scan dependencies. Use dependency-scanning tools to flag known malicious or vulnerable package versions in lockfiles. Scanning is not a guarantee against new or concealed threats, but it gives your team another useful check before a package reaches a build.

  4. Treat build files as code. Review Gradle scripts, Xcode project settings and build phases, especially in repositories you didn’t create. Look for unexpected commands, network requests or encoded scripts. Keep sample apps and examples within the review process too.

  5. Protect developer devices. Keep operating systems and development tools patched, and use endpoint security that can detect suspicious behaviour, not just known malware files. Make sure monitoring covers developer Macs as well as office computers and servers.

  6. Build and verify carefully. Where practical, use clean, controlled build environments and restrict the credentials available to them. Review build changes before release and check that the resulting app matches the expected source and process.

  7. Ask your development partner how they vet packages. A good partner should be able to explain how they track dependency versions, review updates, secure developer machines and respond if a package is flagged.

If your team believes it built the infected example, don’t assume deleting the package is enough. Pause work on the affected device and ask your security or development team to investigate the machine and any repositories it accessed. If there’s a credible sign of compromise, treat it as a security incident and assess potentially exposed credentials and projects with professional support.

Key insights

  • The affected release was universal_file_viewer 0.1.5, discovered in September 2026.
  • Aikido found the malicious files in the package’s example app, not its main Dart library.
  • The reported risk was to developers who cloned the project and built that example, not to everyone who simply added the package as an app dependency.
  • Official repositories and security tools are valuable, but neither replaces careful version control, build review and protection for developer devices.

A safer app starts before the first line of feature code: with the devices, dependencies and build process behind it. Picnic IT builds and maintains apps and helps secure the wider environment with endpoint security and 24/7 monitoring. If you’re planning a Flutter app, or want to review how yours is built, we’d be happy to talk. What checks does your team use before a new package makes it into a build?

Scroll to Top