Skip to content

Commit c2ec248

Browse files
authored
Merge pull request LykosAI#1106 from LykosAI/main
v2.13.2
2 parents a353386 + f42ce09 commit c2ec248

File tree

6 files changed

+229
-7
lines changed

6 files changed

+229
-7
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@ All notable changes to Stability Matrix will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning 2.0](https://semver.org/spec/v2.0.0.html).
77

8+
## v2.13.2
9+
### Changed
10+
- Removed SimpleSDXL due to security concerns - thanks to @iwr-redmond for the detailed report. For more information please visit https://github.com/LykosAI/StabilityMatrix/security/advisories.
11+
### Supporters
12+
#### Visionaries
13+
- Many thanks to our amazing Visionary-tier Patrons, **Waterclouds** and **TheTekknician**! Your support is greatly appreciated!
14+
#### Pioneers
15+
- Shoutout to our Pioneer-tier Patrons, **tankfox**, **Mr. Unknown**, **Szir777**, **Tigon**, and **NowFallenAngel**! Thank you for your continued support!
16+
817
## v2.13.1
918
### Changed
1019
- Redesigned the Checkpoint Manager Filter flyout to include more options and improve the layout

StabilityMatrix.Avalonia/Services/RunningPackageService.cs

Lines changed: 109 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Collections.Immutable;
4-
using System.Linq;
5-
using System.Threading;
6-
using System.Threading.Tasks;
1+
using System.Collections.Immutable;
72
using Avalonia.Controls.Notifications;
3+
using Avalonia.Threading;
84
using CommunityToolkit.Mvvm.ComponentModel;
5+
using FluentAvalonia.UI.Controls;
96
using Injectio.Attributes;
107
using KeyedSemaphores;
118
using Microsoft.Extensions.Logging;
129
using Nito.Disposables.Internals;
10+
using StabilityMatrix.Avalonia.Languages;
1311
using StabilityMatrix.Avalonia.Models;
1412
using StabilityMatrix.Avalonia.ViewModels;
1513
using StabilityMatrix.Core.Extensions;
@@ -79,6 +77,111 @@ IPyRunner pyRunner
7977
return null;
8078
}
8179

80+
// Show warning if critical vulnerabilities are found
81+
if (basePackage.HasCriticalVulnerabilities)
82+
{
83+
var vulns = basePackage
84+
.KnownVulnerabilities.Where(v => v.Severity == VulnerabilitySeverity.Critical)
85+
.Select(
86+
v =>
87+
$"**{v.Id}**: {v.Title}\n - Severity: {v.Severity}\n - Description: {v.Description}"
88+
)
89+
.ToList();
90+
91+
var message =
92+
$"# ⚠️ Critical Security Vulnerabilities\n\nThis package has critical security vulnerabilities that may put your system at risk:\n\n{string.Join("\n\n", vulns)}";
93+
message +=
94+
"\n\nFor more information, please visit the [GitHub Security Advisory page](https://github.com/LykosAI/StabilityMatrix/security/advisories).";
95+
96+
var dialog = DialogHelper.CreateMarkdownDialog(message, "Security Warning");
97+
98+
dialog.IsPrimaryButtonEnabled = false;
99+
dialog.PrimaryButtonText = "Continue Anyway (3)";
100+
dialog.CloseButtonText = Resources.Action_Cancel;
101+
dialog.DefaultButton = ContentDialogButton.Close;
102+
103+
// Start a timer to enable the button after 3 seconds
104+
var countdown = 3;
105+
var timer = new System.Timers.Timer(1000);
106+
timer.Elapsed += (_, _) =>
107+
{
108+
Dispatcher.UIThread.Post(() =>
109+
{
110+
countdown--;
111+
if (countdown <= 0)
112+
{
113+
dialog.IsPrimaryButtonEnabled = true;
114+
dialog.PrimaryButtonText = "Continue Anyway";
115+
timer.Stop();
116+
timer.Dispose();
117+
}
118+
else
119+
{
120+
dialog.PrimaryButtonText = $"Continue Anyway ({countdown})";
121+
}
122+
});
123+
};
124+
timer.Start();
125+
126+
var result = await dialog.ShowAsync();
127+
if (result != ContentDialogResult.Primary)
128+
{
129+
return null;
130+
}
131+
}
132+
// Show warning if any vulnerabilities are found
133+
else if (basePackage.HasVulnerabilities)
134+
{
135+
var vulns = basePackage
136+
.KnownVulnerabilities.Select(
137+
v =>
138+
$"**{v.Id}**: {v.Title}\n - Severity: {v.Severity}\n - Description: {v.Description}"
139+
)
140+
.ToList();
141+
142+
var message =
143+
$"# ⚠️ Security Notice\n\nThis package has known vulnerabilities:\n\n{string.Join("\n\n", vulns)}";
144+
145+
message +=
146+
"\n\nFor more information, please visit the [GitHub Security Advisory page](https://github.com/LykosAI/StabilityMatrix/security/advisories).";
147+
148+
var dialog = DialogHelper.CreateMarkdownDialog(message, "Security Notice");
149+
150+
dialog.IsPrimaryButtonEnabled = false;
151+
dialog.PrimaryButtonText = "Continue Anyway (3)";
152+
dialog.CloseButtonText = Resources.Action_Cancel;
153+
dialog.DefaultButton = ContentDialogButton.Close;
154+
155+
// Start a timer to enable the button after 3 seconds
156+
var countdown = 3;
157+
var timer = new System.Timers.Timer(1000);
158+
timer.Elapsed += (_, _) =>
159+
{
160+
Dispatcher.UIThread.Post(() =>
161+
{
162+
countdown--;
163+
if (countdown <= 0)
164+
{
165+
dialog.IsPrimaryButtonEnabled = true;
166+
dialog.PrimaryButtonText = "Continue Anyway";
167+
timer.Stop();
168+
timer.Dispose();
169+
}
170+
else
171+
{
172+
dialog.PrimaryButtonText = $"Continue Anyway ({countdown})";
173+
}
174+
});
175+
};
176+
timer.Start();
177+
178+
var result = await dialog.ShowAsync();
179+
if (result != ContentDialogResult.Primary)
180+
{
181+
return null;
182+
}
183+
}
184+
82185
// If this is the first launch (LaunchArgs is null),
83186
// load and save a launch options dialog vm
84187
// so that dynamic initial values are saved.

StabilityMatrix.Core/Helper/Factory/PackageFactory.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,10 @@ public BasePackage GetNewBasePackage(InstalledPackage installedPackage)
102102

103103
public IEnumerable<BasePackage> GetAllAvailablePackages()
104104
{
105-
return basePackages.Values.OrderBy(p => p.InstallerSortOrder).ThenBy(p => p.DisplayName);
105+
return basePackages
106+
.Values.Where(p => !p.HasVulnerabilities)
107+
.OrderBy(p => p.InstallerSortOrder)
108+
.ThenBy(p => p.DisplayName);
106109
}
107110

108111
public BasePackage? FindPackageByName(string? packageName)

StabilityMatrix.Core/Models/Packages/BasePackage.cs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,4 +267,30 @@ protected Task InstallCpuTorch(
267267
}
268268

269269
public abstract Task<DownloadPackageVersionOptions?> GetUpdate(InstalledPackage installedPackage);
270+
271+
/// <summary>
272+
/// List of known vulnerabilities for this package
273+
/// </summary>
274+
public virtual IReadOnlyList<PackageVulnerability> KnownVulnerabilities { get; protected set; } =
275+
Array.Empty<PackageVulnerability>();
276+
277+
/// <summary>
278+
/// Whether this package has any known vulnerabilities
279+
/// </summary>
280+
public bool HasVulnerabilities => KnownVulnerabilities.Any();
281+
282+
/// <summary>
283+
/// Whether this package has any critical vulnerabilities
284+
/// </summary>
285+
public bool HasCriticalVulnerabilities =>
286+
KnownVulnerabilities.Any(v => v.Severity == VulnerabilitySeverity.Critical);
287+
288+
/// <summary>
289+
/// Check for any new vulnerabilities from external sources
290+
/// </summary>
291+
public virtual Task CheckForVulnerabilities(CancellationToken cancellationToken = default)
292+
{
293+
// Base implementation does nothing - derived classes should implement their own vulnerability checking
294+
return Task.CompletedTask;
295+
}
270296
}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
using System;
2+
3+
namespace StabilityMatrix.Core.Models.Packages;
4+
5+
/// <summary>
6+
/// Represents a security vulnerability in a package
7+
/// </summary>
8+
public class PackageVulnerability
9+
{
10+
/// <summary>
11+
/// Unique identifier for the vulnerability (e.g. CVE number)
12+
/// </summary>
13+
public string Id { get; set; } = string.Empty;
14+
15+
/// <summary>
16+
/// Short title describing the vulnerability
17+
/// </summary>
18+
public string Title { get; set; } = string.Empty;
19+
20+
/// <summary>
21+
/// Detailed description of the vulnerability
22+
/// </summary>
23+
public string Description { get; set; } = string.Empty;
24+
25+
/// <summary>
26+
/// URL with more information about the vulnerability
27+
/// </summary>
28+
public Uri? InfoUrl { get; set; }
29+
30+
/// <summary>
31+
/// Severity level of the vulnerability
32+
/// </summary>
33+
public VulnerabilitySeverity Severity { get; set; }
34+
35+
/// <summary>
36+
/// When this vulnerability was discovered/published
37+
/// </summary>
38+
public DateTimeOffset PublishedDate { get; set; }
39+
40+
/// <summary>
41+
/// Version ranges affected by this vulnerability
42+
/// </summary>
43+
public string[] AffectedVersions { get; set; } = Array.Empty<string>();
44+
45+
/// <summary>
46+
/// Version that fixes this vulnerability, if available
47+
/// </summary>
48+
public string? FixedInVersion { get; set; }
49+
}
50+
51+
/// <summary>
52+
/// Severity levels for package vulnerabilities
53+
/// </summary>
54+
public enum VulnerabilitySeverity
55+
{
56+
Low,
57+
Medium,
58+
High,
59+
Critical
60+
}

StabilityMatrix.Core/Models/Packages/SimpleSDXL.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,27 @@ IPrerequisiteHelper prerequisiteHelper
3333
public override IEnumerable<TorchIndex> AvailableTorchIndices => [TorchIndex.Cuda];
3434
public override bool IsCompatible => HardwareHelper.HasNvidiaGpu();
3535

36+
public override IReadOnlyList<PackageVulnerability> KnownVulnerabilities =>
37+
[
38+
new()
39+
{
40+
Id = "GHSA-qq8j-phpf-c63j",
41+
Title = "Undisclosed Data Collection and Remote Access in simpleai_base Dependency",
42+
Description =
43+
"SimpleSDXL depends on simpleai_base which contains compiled Rust code with:\n"
44+
+ "- Undisclosed remote access functionality using rathole\n"
45+
+ "- Hidden system information gathering via concealed executable calls\n"
46+
+ "- Covert data upload to tokentm.net (blockchain-associated domain)\n"
47+
+ "- Undisclosed VPN functionality pointing to servers blocked by Chinese authorities\n\n"
48+
+ "This poses significant security and privacy risks as system information is uploaded without consent "
49+
+ "and the compiled nature of the code means the full extent of the remote access capabilities cannot be verified.",
50+
Severity = VulnerabilitySeverity.Critical,
51+
PublishedDate = DateTimeOffset.Parse("2025-01-11"),
52+
InfoUrl = new Uri("https://github.com/metercai/SimpleSDXL/issues/97"),
53+
AffectedVersions = ["*"], // Affects all versions
54+
}
55+
];
56+
3657
public override List<LaunchOptionDefinition> LaunchOptions =>
3758
[
3859
new()

0 commit comments

Comments
 (0)