Skip to content

Conversation

@hmac
Copy link
Contributor

@hmac hmac commented Feb 19, 2023

This pattern is commonly used to sanitize binary enums. For example:

sort_dir = "up" unless sort_dir == "down"

This acts as a barrier guard for taint in sort_dir because after this
statement, the variable can only have one of two possible constant
values: "up" and "down".

@github-actions github-actions bot added the Ruby label Feb 19, 2023
@hmac hmac force-pushed the unless-barrier-guard branch from 089daf4 to b916978 Compare February 19, 2023 06:35
@hmac hmac force-pushed the unless-barrier-guard branch 2 times, most recently from ee536d2 to 422d3f6 Compare March 13, 2023 06:28
hmac added 4 commits March 25, 2023 12:50
This pattern is commonly used to sanitize binary enums. For example:

    sort_dir = "up" unless sort_dir == "down"

This acts as a barrier guard for taint in `sort_dir` because after this
statement, the variable can only have one of two possible constant
values: `"up"` and `"down"`.
@hmac hmac force-pushed the unless-barrier-guard branch from 422d3f6 to 1e2a42a Compare March 24, 2023 23:51
@hmac hmac closed this May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant