PSaxena149153 (Community Member) asked a question.

Hi,

Getting the issue Use of Hard-coded Password (CWE ID 259) after the vera code scan.

Hi,

 

I'm using a piece of code related to the HttpClient in C# so passing some of the value as a parameter like:

 

var httpResponse = await this.httpClient.GetAsync(new Uri("https://api.vimeo.com/me/albums/" + playListID + "/videos?access_token=" + this.GetVimeoAccessToken(clientId, clientSecret)));

 

Getting the issue  Use of Hard-coded Password (CWE ID 259) after the vera code scan.

 

So please guide how I handle the Hard-Coded Password issue.


  • PSaxena149153 (Community Member)

    Hi Team,

     

    Getting CWE 259 on the http client code I have already replace the hardcoded parameter value form the setting but still I'm getting the same.

     

     public async Task<VimeoResponse> GetPlayListVideos(string playListID, string clientId, string clientSecret)

        {

          var vimeoEndpoints = SettingsKeyInfoProvider.GetValue("VimeoAPIURL");

          var vimeoUriParameter = SettingsKeyInfoProvider.GetValue("ViemoParameter");

          var viemoAddress = $"{vimeoEndpoints}{playListID}{vimeoUriParameter}{this.GetVimeoAccessToken(clientId, clientSecret)}";

          var httpResponse = await this.httpClient.GetAsync(new Uri(viemoAddress));

          var response = await httpResponse.Content.ReadAsStringAsync();

          return JsonConvert.DeserializeObject<VimeoResponse>(response);

        }

     

     

    image.png

    Expand Post
  • Georges (Community Member)

    Likely this stems from having the word "Secret" in a variable. I've seen Veracode flag the string "CSharpAssembly" because it has the substring "pAss" in there. When you retrieve the actual value of the "clientSecret", where does that come from? If that value comes from any source that is not a fit-for-purpose secret management solution (e.g. azure key vault) then this should be addressed or accepted.

     

    If the value *is* inside a keyvault and the only thing Veracode is flagging is the fact that you should validate that there is not really a hard-coded secret, then this would classify a s a false positive.

    Expand Post
  • IAswin566074 (Community Member)

    Hi Team,

    Getting the issue Use of Hard-coded Password (CWE ID 259) after the vera code scan.

    in my code i am using user_secret like [123, 512, [], "f21b", "M5.8s67.7-2.1 96-5.8v10.8c-.1.1-5.6 3.2-6.4 5.8z"]

     

Topics (2)

No articles found
Loading

Ask the Community

Get answers, share a use case, discuss your favorite features, or get input from the community.