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

Security Vulnerability - How about using environment variable? #1

Open
prafullmaru opened this issue Jun 6, 2024 · 1 comment
Open

Comments

@prafullmaru
Copy link

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
Copy link
Owner

adbtae commented Jun 6, 2024

there is a compiled version, thx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants