PSAvoidUsingConvertToSecureStringWithPlainText makes unreasonable claims at high severity

Open
#2,187 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Quiet
Tech stack
csharp, powershell
Domain
security, tooling

Research direction

Start by locating the PSAvoidUsingConvertToSecureStringWithPlainText rule entry point and reviewing how its message and severity are defined. Compare those claims with the credential and token scenarios described in the issue; done means the rule's severity and guidance no longer make unsupported repo-wide security claims.

Written by the indexing model from the issue text.

Description

Internal MS situation:

PSAvoidUsingConvertToSecureStringWithPlainText is now generating SFI/s360 work based on unsupported claims with neither Guardian nor TSA teams able to offer repo-wide suppression options.

This will expose secure information. Encrypted standard strings should be used instead.

Will it? Why is it an error?
I challenge you to create Credential instance from a token or another credential following this guidance.

There are workarounds of course and line-by-line suppressions, but they don't scale or make security story any stronger and we can't provide our own rules/settings for the linter.

Dominant language
C#
Stars
2.2k
Forks
415
Avg merge
13h 1m
Merged PRs (30d)
2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from PowerShell/PSScriptAnalyzer

All issues in PowerShell/PSScriptAnalyzer

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.