
Research
PyPI Package Disguised as Instagram Growth Tool Harvests User Credentials
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.
AspNetHeaderReplicator
Advanced tools
AspNetHeaderReplicator: Middleware for replicating HTTP request headers into response headers efficiently with the rules you determined.
This is a simple library that exposes a middleware for ASP.NET Core applications that replicates headers from the request to the response with the ability to include or exclude specific headers.
AspNetHeaderReplicator is available as a NuGet package. You can install it using the NuGet Package Manager Console:
dotnet add package AspNetHeaderReplicator
Or with the nuget
command:
nuget install AspNetHeaderReplicator
To use the middleware, you need to add it to the pipeline in the Configure
method of your Startup
class (Or you can use without the Startup
class if you are using the generic host):
By default, the middleware will replicate and ignore the following headers:
new[] { "X-", "My-", "Req-", "Trace-", "Debug-", "Verbose-" }
new[] { "auth", "credential", "token", "pass", "secret", "hash", "cert" };
public void ConfigureServices(IServiceCollection services)
{
services.AddHeaderReplicator();
}
Following code snippet will allow headers starting with Allowed-Prefix
to be replicated.
public void ConfigureServices(IServiceCollection services)
{
services.AddHeaderReplicator(opt =>
{
// Allow headers starting with
opt.AllowHeaderPrefix("Allowed-Prefix");
});
}
Following code snippet will ignore headers containing ignored
in their name.
public void ConfigureServices(IServiceCollection services)
{
services.AddHeaderReplicator(opt =>
{
// Ignore headers containing
opt.IgnoreHeaderSentence("ignored");
});
}
Following code snippet will clear all default settings and allow headers starting with X-
and My-
and ignore headers containing auth
and credential
.
public void ConfigureServices(IServiceCollection services)
{
services.AddHeaderReplicator(opt =>
{
// Clear all default settings
opt.ClearAll();
// Allow headers starting with
opt.AllowHeaderPrefix("X-");
opt.AllowHeaderPrefix("My-");
// Ignore headers containing
opt.IgnoreHeaderSentence("auth");
opt.IgnoreHeaderSentence("credential");
});
}
You can create a new API project and apply the following changes...
...
...
public void ConfigureServices(IServiceCollection services)
{
services.AddHeaderReplicator(opt =>
{
// Clear all default settings
opt.ClearAll();
// Allow headers starting with
opt.AllowHeaderPrefix("X-");
opt.AllowHeaderPrefix("My-");
// Ignore headers containing
opt.IgnoreHeaderSentence("auth");
opt.IgnoreHeaderSentence("credential");
});
}
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
app.UseHeaderReplicator();
app.UseRouting();
app.UseEndpoints(endpoints =>
{
endpoints.Map("/", context =>
{
return context.Response.WriteAsync("Please inspect the headers of this response.");
});
});
}
...
...
Run the API and make a request to the root URL. You can use curl
or any other tool to inspect the headers of the response.
curl --location 'http://localhost:5278/' \
--header 'X-Burak: Burak Tungut' \
--header 'My-Some: 123' \
--header 'Some-Auth-Key: somesecrets' \
--header 'a-header-credential-demo: somesecrets'
As you can see, headers are being executing without case sensitivity.
Response headers will be like below:
As you can see, headers are being replicated and/or ignored according to the configuration.
This project is licensed under the MIT License - see the LICENSE file for details.
Owner : Burak Tungut
Any contributions are welcome! Please post your issues and pull requests to the repository.
Regards...
FAQs
AspNetHeaderReplicator: Middleware for replicating HTTP request headers into response headers efficiently with the rules you determined.
We found that aspnetheaderreplicator 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
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.
Product
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.
Security News
Research
Socket uncovered two npm packages that register hidden HTTP endpoints to delete all files on command.