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

fix: Fix psalm taint errors #50800

Merged
merged 9 commits into from
Feb 17, 2025
Merged

fix: Fix psalm taint errors #50800

merged 9 commits into from
Feb 17, 2025

Conversation

come-nc
Copy link
Contributor

@come-nc come-nc commented Feb 13, 2025

Summary

Fix issues listed by psalm as taint errors by correctly tagging functions which are escaping or checking input.

Checklist

@come-nc come-nc added the 2. developing Work in progress label Feb 13, 2025
@come-nc come-nc added this to the Nextcloud 32 milestone Feb 13, 2025
@come-nc come-nc self-assigned this Feb 13, 2025
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Especially with JSON_HEX_TAG it’s perfectly fine to echo JSON, and we
 only use it in JSON output anyway.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
var_export is listed as a taint sink because it may output stuff
 depending on the parameters. It was not the case here, but we can
 simply json_encode the result by passing it as context to the logger
 method rather than using var_export.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
…admin_audit

Same issue as var_export, print_r is listed as sink but it’s not when
 using return:true. Anyway, using the logger context feature is better.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This solves some false-positive psalm taint errors

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
 …in psalm taint analysis

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
@come-nc come-nc force-pushed the fix/fix-psalm-taint-errors branch from 1debb5d to c1c59f9 Compare February 17, 2025 14:26
@come-nc come-nc changed the title fix: Fix psalm taint error in L10N factory fix: Fix psalm taint errors Feb 17, 2025
@come-nc come-nc added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Feb 17, 2025
@come-nc come-nc marked this pull request as ready for review February 17, 2025 14:49
@susnux susnux merged commit 9edabfa into master Feb 17, 2025
193 checks passed
@susnux susnux deleted the fix/fix-psalm-taint-errors branch February 17, 2025 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants