Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Snyk] Fix for 5 vulnerabilities #379

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix: package.json & yarn.lock to reduce vulnerabilities
snyk-bot committed Sep 24, 2024
commit c38cb5bf31ba7873b4613f82f70737c81f4580f8
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -14,10 +14,10 @@
"write-heading-ids": "docusaurus write-heading-ids docs"
},
"dependencies": {
"@docusaurus/core": "^2.4.1",
"@docusaurus/plugin-google-gtag": "^2.4.3",
"@docusaurus/plugin-sitemap": "^2.4.3",
"@docusaurus/preset-classic": "^2.4.1",
"@docusaurus/core": "^3.0.1",
"@docusaurus/plugin-google-gtag": "^3.0.1",
"@docusaurus/plugin-sitemap": "^3.0.1",
"@docusaurus/preset-classic": "^3.0.1",
"@mdx-js/react": "^1.6.22",
"clsx": "^1.1.1",
"prism-react-renderer": "^1.3.1",
7,274 changes: 4,020 additions & 3,254 deletions yarn.lock

Large diffs are not rendered by default.


Unchanged files with check annotations Beta

public static TokenProvider CreateFromLogin(string user, string password)
{
throw new NotImplementedException();
var tm = new TokenProvider();

Check warning on line 122 in src/gsudo/Tokens/TokenProvider.cs

GitHub Actions / Test

Unreachable code detected

Check warning on line 122 in src/gsudo/Tokens/TokenProvider.cs

GitHub Actions / Test

Unreachable code detected
return tm.Duplicate(MAXIMUM_ALLOWED);
}
{
System.Environment.CurrentDirectory = elevationRequest.StartFolder;
}
catch (UnauthorizedAccessException ex)

Check warning on line 64 in src/gsudo/ProcessRenderers/TokenSwitchRenderer.cs

GitHub Actions / Test

The variable 'ex' is declared but never used

Check warning on line 64 in src/gsudo/ProcessRenderers/TokenSwitchRenderer.cs

GitHub Actions / Test

The variable 'ex' is declared but never used
{
throw new ApplicationException($"User \"{WindowsIdentity.GetCurrent().Name}\" can not access directory \"{elevationRequest.StartFolder}\"");
}
return service;
}
public static async Task<ServiceLocation> FindAnyServiceFast()

Check warning on line 53 in src/gsudo/Helpers/ServiceHelper.cs

GitHub Actions / Test

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 53 in src/gsudo/Helpers/ServiceHelper.cs

GitHub Actions / Test

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.
{
string user = WindowsIdentity.GetCurrent().User.Value;
var callerProcessId = Process.GetCurrentProcess().Id;
{
System.Environment.CurrentDirectory = elevationRequest.StartFolder;
}
catch (UnauthorizedAccessException ex)

Check warning on line 38 in src/gsudo/ProcessHosts/AttachedConsoleHost.cs

GitHub Actions / Test

The variable 'ex' is declared but never used

Check warning on line 38 in src/gsudo/ProcessHosts/AttachedConsoleHost.cs

GitHub Actions / Test

The variable 'ex' is declared but never used
{
throw new ApplicationException($"User \"{WindowsIdentity.GetCurrent().Name}\" can not access directory \"{elevationRequest.StartFolder}\"");
}
public static bool Direct { get; internal set; }
// Target Integrity Level
public static IntegrityLevel? IntegrityLevel { get; internal set; }

Check warning on line 32 in src/gsudo/InputParameters.cs

GitHub Actions / Test

The property name 'IntegrityLevel' is confusing given the existence of method 'GetIntegrityLevel'. Rename or remove one of these members. (https://docs.microsoft.com/visualstudio/code-quality/ca1721-property-names-should-not-match-get-methods)

Check warning on line 32 in src/gsudo/InputParameters.cs

GitHub Actions / Test

The property name 'IntegrityLevel' is confusing given the existence of method 'GetIntegrityLevel'. Rename or remove one of these members. (https://docs.microsoft.com/visualstudio/code-quality/ca1721-property-names-should-not-match-get-methods)
// Elevate as "NT Authority\System"
public static bool RunAsSystem { get; internal set; }
SendNotifyMessage(HWND_BROADCAST, WM_SETTINGCHANGE, UIntPtr.Zero, "Environment");
}
[DllImport("user32.dll", CharSet = CharSet.Auto)]

Check warning on line 60 in src/gsudo/AppSettings/PathPrecedenceSetting.cs

GitHub Actions / Test

Specify marshaling for P/Invoke string arguments (https://docs.microsoft.com/visualstudio/code-quality/ca2101-specify-marshaling-for-p-invoke-string-arguments)

Check warning on line 60 in src/gsudo/AppSettings/PathPrecedenceSetting.cs

GitHub Actions / Test

Specify marshaling for P/Invoke string arguments (https://docs.microsoft.com/visualstudio/code-quality/ca2101-specify-marshaling-for-p-invoke-string-arguments)
private static extern bool SendNotifyMessage(
IntPtr hWnd, uint Msg, UIntPtr wParam, string lParam);
if (Value is string)
return ($"\"{Value.ToString().Replace("\\", "\\\\")}\"");
else if (Value is bool)
return ($"{Value.ToString().ToLowerInvariant()}");

Check warning on line 99 in src/gsudo/Commands/StatusCommand.cs

GitHub Actions / Test

In method 'GetJsonValue', replace the call to 'ToLowerInvariant' with 'ToUpperInvariant'. (https://docs.microsoft.com/visualstudio/code-quality/ca1308-normalize-strings-to-uppercase)

Check warning on line 99 in src/gsudo/Commands/StatusCommand.cs

GitHub Actions / Test

In method 'GetJsonValue', replace the call to 'ToLowerInvariant' with 'ToUpperInvariant'. (https://docs.microsoft.com/visualstudio/code-quality/ca1308-normalize-strings-to-uppercase)
else if (Value is Array)
{
var sb = new StringBuilder();
{
Logger.Instance.Log("This service is not running with desired credentials. Starting a new service instance.", LogLevel.Info);
#if DEBUG
await Task.Delay(2000);

Check warning on line 64 in src/gsudo/Commands/ServiceCommand.cs

GitHub Actions / Test

Consider calling ConfigureAwait on the awaited task (https://docs.microsoft.com/visualstudio/code-quality/ca2007-do-not-directly-await-task)

Check warning on line 64 in src/gsudo/Commands/ServiceCommand.cs

GitHub Actions / Test

Consider calling ConfigureAwait on the awaited task (https://docs.microsoft.com/visualstudio/code-quality/ca2007-do-not-directly-await-task)
#endif
ServiceHelper.StartService(AllowedPid, CacheDuration, AllowedSid, SingleUse);
return 0;
{
internal class UACWindowFocusHelper
{
[DllImport("user32.dll", SetLastError = true)]

Check warning on line 10 in src/gsudo/Helpers/UACWindowFocusHelper.cs

GitHub Actions / Test

Specify marshaling for P/Invoke string arguments (https://docs.microsoft.com/visualstudio/code-quality/ca2101-specify-marshaling-for-p-invoke-string-arguments)

Check warning on line 10 in src/gsudo/Helpers/UACWindowFocusHelper.cs

GitHub Actions / Test

Specify marshaling for P/Invoke string arguments (https://docs.microsoft.com/visualstudio/code-quality/ca2101-specify-marshaling-for-p-invoke-string-arguments)
private static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
internal static void StartBackgroundThreadToFocusUacWindow()
if (uacWindow != IntPtr.Zero)
{
// Set focus to the UAC window
WindowApi.SetForegroundWindow(uacWindow);

Check warning on line 35 in src/gsudo/Helpers/UACWindowFocusHelper.cs

GitHub Actions / Test

FocusUacWindow calls SetForegroundWindow but does not use the HRESULT or error code that the method returns. This could lead to unexpected behavior in error conditions or low-resource situations. Use the result in a conditional statement, assign the result to a variable, or pass it as an argument to another method. (https://docs.microsoft.com/visualstudio/code-quality/ca1806-do-not-ignore-method-results)

Check warning on line 35 in src/gsudo/Helpers/UACWindowFocusHelper.cs

GitHub Actions / Test

FocusUacWindow calls SetForegroundWindow but does not use the HRESULT or error code that the method returns. This could lead to unexpected behavior in error conditions or low-resource situations. Use the result in a conditional statement, assign the result to a variable, or pass it as an argument to another method. (https://docs.microsoft.com/visualstudio/code-quality/ca1806-do-not-ignore-method-results)
return;
}
}