Skip to content

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
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 <[email protected]>
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 <[email protected]>
…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 <[email protected]>
This solves some false-positive psalm taint errors

Signed-off-by: Côme Chilliet <[email protected]>
 …in psalm taint analysis

Signed-off-by: Côme Chilliet <[email protected]>
@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
@nextcloud-bot nextcloud-bot mentioned this pull request Aug 19, 2025
@skjnldsv skjnldsv modified the milestones: Nextcloud 32, Nextcloud 33 Sep 28, 2025
@skjnldsv skjnldsv added this to the Nextcloud 32 milestone Oct 2, 2025
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.

5 participants