Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [.net]

A runtime, architecture, and libraries for Microsoft Windows used for creating applications.

-2
votes
0answers
8 views

Clinet to Server

Every 3 seconds, the Server sends the Client a command to ask for data, e.g., through a single letter “R” or “r” (request). In C program run on visual Studio 2019
3
votes
0answers
58 views

How secure is this combined sha1/md5 hash [duplicate]

Recently we outsourced some work for a website. While reviewing this code I came across the password hash function. I am in no way a security expert besides some basic knowledge (hence outsourcing ...
1
vote
1answer
57 views

Can I decrypt a .gpg file by using Windows CNG store/ProtectedData?

I'm creating this tool in C# that would take a .gpg file and decrypt it using Windows CNG. I get a .gpg file as my input parameter and it is encrypted with my key using WinPT. Decrypting it works with ...
0
votes
1answer
55 views

SQL injection in Windows Services?

I have many Windows services which run on the server side only. It performs few CRUD operations on a database (MySQL). There is a client application which allows a user to upload files through it to ...
0
votes
0answers
51 views

How to store SSN in asp.net web-based application on a short-term basis?

After scouring the web to find countless similar questions, I still find it important enough to ask based on my client's specific requirements. Now I know most if not all are not a lawyer, but if you'...
3
votes
2answers
136 views

BCrypt workfactor for salt?

From what I read here: How to securely hash passwords?, you're supposed to iterate the hashing. However in the implementation of BCrypt for .Net uses the workfactor (2^wf iterations) in the '...
0
votes
2answers
132 views

How to hide a process in Windows?

Is there a way to make a process hidden without using any Administrator-level priviledges? I am building an antivirus which I want to protect from malware's actions, such as ending the process, or ...
2
votes
0answers
54 views

Is Jil vulnerable to Friday The 13th JSON attack?

Is the .NET JSON (de-)serializer Jil vulnerable to Friday The 13th JSON attack when deserializing untrusted input? If this attack is applicable, how can it be prevented? Explanation of the attack: ...
0
votes
1answer
32 views

Revoke OAuth2 Token For Mobile App

When a user logs into my mobile app it uses OAuth to authenticate them and generates a token. The token is then checked against each subsequent request. Each user account in my application has an ...
2
votes
1answer
120 views

Decrypting SSL traffic using Fiddler to see requests being sent by malware written in .NET

I tried to find the GET data of some malware but it appears that this malware is encrypting traffic using SSL. When I tried to decrypt the SSL data via Fiddler, I always get nothing — only ...
2
votes
0answers
290 views

ASP.NET SOAP Service XXE

Is it possible to do any type of XXE in a service developed using default C# SOAP service framework? I ask because any type of XXE payload I try to add, even XML header, whatever I add before SOAP ...
3
votes
1answer
134 views

BouncyCastle and Microsoft Cng ECDH secret key mismatch

I'm trying to refactor some client-side code from BouncyCastle to Microsoft Cng. I've figured out how to convert key format(ECC key blobs) between them, but I couldn't calculate the same secret. ...
0
votes
2answers
60 views

Security risks downloading external images automatically from script

I'm a developping a program which generates images from HTML files filled with external RSS feeds data. When the RSS feed contains images, I need to check their resolution and format (for instance, if ...
1
vote
1answer
52 views

Can you fake the Host attribute of a C# URI?

I was wondering if you can fake the Uri.Host value of a string. For example, given the following code: new Uri(url.ToLower()).Host == "example.com" Is there anyway to have this boolean comparison be ...
1
vote
1answer
239 views

How to pass a localhost check for an incoming request?

I'm trying to send a request to an http server hosted on a machine. The http server is in C# and drops any packets that are not from localhost: public void Request(HttpListenerContext context) { ...
1
vote
1answer
75 views

How to prevent expired cookies from maintaining accesss?

My company has a website that was recently the target of a security audit. They found that if a hacker had obtained the browser cookies used by our .NET website for authorization, that those cookies ...
0
votes
1answer
51 views

What is a secure way to use PHP tokens in a C# application

I have a C# app that is sending post requests to and from a php script. I have token based authentication setup on the php, and I have my C# app sending the tokens, however, even with obfuscation, if ...
2
votes
1answer
70 views

Risks of letting the browser open local/network file system listing

Browsers do not generally allow web pages to interact with client-side file system as a security measure. I would like to know what can go wrong with the following scenario: Clicking a special ...
2
votes
0answers
60 views

What security precautions should we take when letting a C# application send/receive emails?

I'm writing a web application which will be able to send signed and encrypted emails to someone else outside my trust boundary. It will also retrieve S/MIME encrypted (and maybe also signed) emails ...
3
votes
1answer
131 views

What do you search for in Open Source code to be sure there isn't malicious code?

I realize the answers will be language specific, but I am curious what terms you would look for when checking something out on Github? I was looking for a remote administration tool that I could use ...
1
vote
2answers
60 views

Make application use encrypted credentials from a file [duplicate]

I am new to cyber security but I am working on a project where I need to use it and I don't know where to start. The application I am working on connects to Jira to retrieve data and generate ...
1
vote
2answers
198 views

How to obfuscate a assemblies binary compiled with .NET framework?

How to obfuscate a binary compile with .NET framework? Tools such as Ebowla and Pecloak.py will encrypt it but the program won't run. Even UPX can't pack it. Wondering are there any ways to obfuscate ...
0
votes
0answers
22 views

Replacing single quote with double single quote (SQL Injection sanitation) [duplicate]

Let's say I want to sql inject into a site, and the textbox is for my name. My name is U'ser Smith. The code is handling the single quote by replacing any instance of ' with '' on the users input only....
2
votes
0answers
117 views

HTML Form to PDF vulnerabilities

I have a form where the user inputs data. On the back end, I'm taking some of that data and embedding it into a PDF using ActiveReports. I then display it back to the user and save a copy on our ...
1
vote
0answers
89 views

Veracode still reports OS command injection issue after I have applied the solution as recommendations from OWAPS and Roslyn Security Guard [closed]

Current code in my project is shown below and Veracode reports there is an OS command injection filename = Regex.Replace(filename, "[^a-zA-Z0-9_]", "_") & ".svg" ProcessStartInfo startInfo = ...
1
vote
1answer
736 views

Insecure Deserialization in C# (.NET) - How to identify and test

I have been reading up on Insecure Deserialization and how it can affect Java applications. https://owasp.org/index.php/Top_10-2017_A8-Insecure_Deserialization If the captured traffic data include ...
1
vote
1answer
560 views

Is .NET XmlSerializer.Deserialize(TextReader) safe?

Is the .NET method XmlSerializer.Deserialize(TextReader) safe from XML vulnerabilities (XXE, XmlBomb etc..)? Will the DTD be processed during deserialization? I can understand why XmlSerializer....
0
votes
0answers
142 views

Session Fixation in ASP.NET

I am testing ASP.NET application, where session id (ASP.NET_SessionId) is not renewed after login. Actually it is renewed when I use browser, on the login page server sends: Set-Cookie: ASP....
0
votes
1answer
922 views

Is CBC mode for AES still safe to use in 2018?

I'm using AES-256 CBC mode in C# to encrypt various amounts of texts. The key and IV are always generated properly randomly. However, would GCM mode provide any noticeable security gains over CBC?
2
votes
0answers
58 views

Will installing WinZip 22 on a server create a security vulnerability?

I've recently requested a WinZip v22 with command line installation on a Windows POC/Dev server that we're using to pilot an application that is written in .Net. In the application there is ...
3
votes
1answer
190 views

What is properly way to manage and remove symmetric key in C#

If I have a symmetric key in a byte[] array in C#, how can I erase it securely? for (int i = 0; i < array.Length; i++) { array[i] = 0; } Is this good enough?
2
votes
1answer
411 views

SSL certificate for WebAPI

We have a simple system with a REST service (WebAPI) that will be hosted on one machine (hosted on IIS on a custom port, port numer 3031) and with a website hosted on another machine that will be ...
2
votes
1answer
148 views

Automatic choice of the hash function for key derivation

This is a theoretical question: does this make sense and is secure? My goal is to strengthen the passphrase. The flow is the following: I enter a pssphrase admin1234. This passphrase is going to be ...
-2
votes
1answer
77 views

Visual Studio anonymity

Recently me and me colleague was wondering about obfuscating / removing project info. If application is reverse engineered than what kind of information the engineer sees? Can he see the email of the ...
0
votes
1answer
370 views

Potentially dangerous request loads the page

I hosted an application in ASP.NET 4.0 webforms. When I am browsing hostname/DressDetail.aspx?<script>alert(313)</script>&category=1&code=76 it is showing an error message like: ...
1
vote
0answers
93 views

Best way to store AES keys (web api) while dealing with multi tenants (key per tenant)

I have some data to encrypt on my database and every tenant will have his own database so surely every tenant will have a different key. I'm searching for the best way to store the key for every ...
0
votes
0answers
226 views

ViewStateUserKey .NET CSRF protection

In a typical PHP web application you append a hidden CSRF Token in each form and this token is validated when the request is submitted in the server side. I am performing a penetration test in a .NET ...
0
votes
1answer
463 views

How to get session info out of encrypted .NET viewstate?

I am performing a penetration testing for the first time in a .NET application that instead of providing cookies for session management uses the viewstate hidden field. I am using the .NET Beautifier ...
1
vote
2answers
467 views

How to securely send a password from one app to another app?

See this question/answer first: When calling a process from another process, Is sending stdin password more secure than sending an ENV variable? I am a Java developer that is building an app where ...
1
vote
1answer
100 views

When calling a process from another process, Is sending stdin password more secure than sending an ENV variable?

I am a Java developer that is building an app where it needs to call a C# process from within. In my situation, the Java app is calling this C# program https://github.com/nddipiazza/...
2
votes
2answers
117 views

How can I verify that network calls to my API come only from my C# program?

I have a desktop application build on the .Net framework. If I obfuscate the code, even if somebody reverse-engineers the code and tries to call my API using the altered source, can I know if the API ...
1
vote
0answers
66 views

Example of Insecure DTD Processing in XmlSchema.Read

According to https://msdn.microsoft.com/en-us/library/mt661872.aspx and https://github.com/dotnet/roslyn-analyzers/issues/563 the code below is vulnerable to DTD expansion attack: var src = "?...
0
votes
1answer
307 views

WPF Hide ConnectionString in MyApplication.exe.config file (or hide the whole file)

While building my Project I got a new file called MyApplication.exe.config. This is the Content of App.config (I guess) where I also included the Connection to a DataBase in <ConnectionString>. ...
2
votes
2answers
64 views

Is it feasible to leverage DOS by triggering large numbers of application exceptions?

One key aspect of a DOS or DDOS seems to be to leverage the required computational power on the attackers side to maximize the impact on the target side. This wiki article lists many examples of such ...
-1
votes
1answer
622 views

Encrypt and decrypt large files with RSA, is it possible? [closed]

Encrypt and decrypt large files with RSA, is it possible? I need to encrypt / decrypt files and save the private key named file encoder I've seen it's not acceptable to work on large files with RSA Is ...
2
votes
1answer
1k views

Could Meltdown/Spectre be exploited from C#/.Net (or other managed languages or the Midori OS)?

First off yes the correct answer is patch your OS/system. That aside: Does the memory managed features of a language like C# prevent it from being used to exploit the Meltdown security bug? What ...
-4
votes
1answer
151 views

Why isn't ASP.NET source code compiled before it is published?

Why doesn't Visual Studio compile the source code (.cs) automatically before publishing, since they know perfectly well that the end-product website is going public? (Unless you're just building the ...
2
votes
1answer
82 views

Can I secure a server on which I'm deliberately allowing code execution?

Context: AI competition. Users upload a dll with a class implementing a provided interface, then the competition runner instantiates that class and invokes various methods on the interface. Obviously,...
1
vote
0answers
98 views

Is there any tool for static analysis of Windows Workflow Foundation XAML files? [closed]

The title says it all. First, is there any dedicated tool that is capable of analysis of Workflow Foundation files? If not, is there a process that can analyse them, eg. compile the WF into IL, then ...
2
votes
2answers
232 views

How secure is this communication chat?

I have created a chat between two parties (using c#), and I am wondering what kind of weaknesses have I overlooked. Description of its functionality: There are two individual applications: Client (2 ...