False positive for `ballerina:14` when a secret-named variable is assigned the result of a function call
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 58/100
Research direction
Locate the implementation and tests for rule ballerina:14, then reproduce the report using the Ballerina snippet in the issue. Trace how the rule distinguishes fixed values from function-call results and add coverage for the runtime-computed assignment. Done means the example produces no ballerina:14 issue while fixed secret assignments remain reported.
Written by the indexing model from the issue text.
Description
Description
Rule ballerina:14 (Non configurable secrets are security-sensitive) reports secret-named variables whose value is computed at runtime by a function call. A value returned from a function isn't a fixed secret, and it can't sensibly be made configurable, so this is a false positive.
The rule's description says it targets "a secret that is assigned a fixed value". A runtime-computed value doesn't fit that.
Steps to Reproduce
Scan a Ballerina file containing:
byte[] sharedSecret = check decapsulateMlKem768(encapsulationResult.encapsulatedSecret, privateKey);
Actual Behavior
Raises a ballerina:14 issue.
Expected Behavior
No issue should be reported. sharedSecret comes from a KEM decapsulation at runtime. It isn't hardcoded, it doesn't need rotating through config, and a derived key should never come from config at all.
Version
0.12.0
Environment Details (with versions)
No response
- Dominant language
- Java
- Stars
- 15
- Forks
- 12
- Avg merge
- 12h 17m
- Merged PRs (30d)
- 13
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ballerina-platform/static-code-analysis-tool
-
Type/Improvement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
ballerina-platform/static-code-analysis-tool#140 ·
Maintainers usually reply within 1 day
-
Type/Improvement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
ballerina-platform/static-code-analysis-tool#139 ·
Maintainers usually reply within 1 day
-
Type/Improvement
Difficulty 5/5 Over a week Newbie friendliness 35/100
ballerina-platform/static-code-analysis-tool#142 ·
Maintainers usually reply within 1 day
-
Type/Improvement
Difficulty 4/5 3-5 days Newbie friendliness 48/100
ballerina-platform/static-code-analysis-tool#141 ·
Maintainers usually reply within 1 day
-
Type/Improvement
Difficulty 3/5 1-2 days Newbie friendliness 62/100
ballerina-platform/static-code-analysis-tool#138 ·
Maintainers usually reply within 1 day
All issues in ballerina-platform/static-code-analysis-tool
Similar issues
-
priority: p2 type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
googleapis/java-genai#1372 ·
Maintainers usually reply within 1 day
-
GeoSeries scale and skew tests fail with pytest 9.2.0Possibly taken @jiayuasu claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
priority: medium Review effort [1-5]: 3 status: needs-triage type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
carlos-emr/carlos#5431 ·
Maintainers usually reply within 1 day
-
Integration tests: jetty:run fails with WELD-001408 for CountryJpaServicePossibly taken @viniciusmachak claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
primefaces/primefaces#15431 ·
Maintainers usually reply within 1 day
-
test(multi-tenancy): assert cross-tenant vulnerability reads are refused in the CWE isolation testOpen
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
OpenAEV-Platform/openaev#8792 ·
Maintainers usually reply within 2 days