adbtae / defi-dex-swap-sniper-bot

A bot with which you can really increase the price of your coin and make money on the falling market
MIT License
6 stars 2 forks source link

Security Vulnerability - How about using environment variable? #1

Open prafullmaru opened 1 month ago

prafullmaru commented 1 month ago

Hi @adbtae

With looking into code, I see we are simply reading text file for our APIKey which will lead to security break. We can consider using environment variables or secure storage.

/blob/main/Defi-BotAdditional/Globals.cs public static string[] keys = System.IO.File.ReadAllLines(@"/Users/aditi/Desktop/Bot/binanceInfo/apiKeys.txt"); //Api Key public static string ApiKey { get; set; } = keys[0]; //Secret Key public static string SecretKey { get; set; } = keys[1];

Also we should validate before using index on array to avoid null exception or index out of bound exception.

adbtae commented 1 month ago

there is a compiled version, thx