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

Allow to define custom taint types classes #9186

Open
ohader opened this issue Jan 25, 2023 · 1 comment · May be fixed by #10736
Open

Allow to define custom taint types classes #9186

ohader opened this issue Jan 25, 2023 · 1 comment · May be fixed by #10736

Comments

@ohader
Copy link
Contributor

ohader commented Jan 25, 2023

Currently custom taint types are plain strings like "anything" and wrapped in class generic TaintedCustom. To add more semantics and better taint graph handling, those types should be regular classes like AnythingTaint and optionally be "connected" to existing groups like TaintKindGroup::ALL_INPUT. In case no specific class is defined, it still falls back to current TaintedCustom behavior.

Example: https://psalm.dev/r/b0cf89613b

@psalm-github-bot
Copy link

I found these snippets:

https://psalm.dev/r/b0cf89613b
<?php // --taint-analysis
/**
 * @psalm-taint-sink anything $value
 */
function any($value) {}
/**
 * @psalm-taint-source anything
 */
function getData(): string {}

$inject = getData();
any($inject);
Psalm output (using commit aec0edc):

ERROR: TaintedCustom - 5:14 - Detected tainted anything

@ohader ohader linked a pull request Feb 22, 2024 that will close this issue
2 tasks
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

Successfully merging a pull request may close this issue.

1 participant