
Research
/Security News
Critical Vulnerability in NestJS Devtools: Localhost RCE via Sandbox Escape
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
HidDeviceReaderLibraryCore
Advanced tools
A library for reading data from HID devices(only HID raw,not for virtual keyboard mode) and parsing JSON payloads.
HidDeviceReaderLibrary
is a .NET library for reading data from USB HID devices (not supporting virtual keyboard mode) and parsing JSON data. It is suitable for scenarios where you need to communicate with HID devices and process their data.
dotnet add package HidDeviceReaderLibrary
using System;
using System.Threading;
using HidDeviceReaderLibrary;
class Program {
static async void Main()
{
// your HID device VendorID 和 ProductID
var reader = new HidDeviceReaderV1(0x2F50, 0x0300);
reader.OnDataReceived += data =>
{
Console.WriteLine($"Received data: {data}");
};
using (var cts = new CancellationTokenSource())
{
// press Ctrl+C cancels
Console.CancelKeyPress += (s, e) => {
e.Cancel = true;
cts.Cancel();
};
await reader.StartReadingAsync(cts.Token);
Console.ReadKey();
}
}
}
// DI version supports
using HidDeviceReaderLibrary;
namespace WebApplicationHIDTests
{
public class Program
{
public static void Main(string[] args)
{
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddLogging();
builder.Services.AddHidDeviceReader(vendorId: 1234, productId: 5678);
builder.Services.AddHostedService<HIDService>();
var app = builder.Build();
app.Run();
}
}
}
// Later, resolve IHidDeviceReader:
//Method 1:
var reader = serviceProvider.GetRequiredService<IHidDeviceReader>();
using (var cts = new CancellationTokenSource())
await reader.StartReadingAsync(cts.Token);
//Method 2:
using HidDeviceReaderLibrary;
using HidSharp;
namespace WebApplicationHIDTests
{
public class HIDService(IHidDeviceReader hidDevice, ILogger<HidDevice> logger) : BackgroundService
{
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
{
logger.LogDebug($"Testing start...");
// Subscribe to the OnDataReceived event correctly
hidDevice.OnDataReceived += data => logger.LogDebug(data);
await hidDevice.StartReadingAsync(stoppingToken);
while (!stoppingToken.IsCancellationRequested)
await Task.Delay(1000, stoppingToken);
}
}
}
FAQs
A library for reading data from HID devices(only HID raw,not for virtual keyboard mode) and parsing JSON payloads.
We found that hiddevicereaderlibrarycore demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.