Created
September 8, 2023 05:29
-
-
Save amitpatelx/cc34541f820cf28b865c8f4dae44e42d to your computer and use it in GitHub Desktop.
Load any random ruby code from internet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# credit https://blog.widefix.com/fake-time-dot-now-in-production/ | |
url = "<HTTP LINK>" | |
code = open(url).read | |
puts code | |
# It’s important to carefully review the code before evaluating it, to ensure it is the original, | |
# intended code and not something malicious. | |
# Only after confirming the authenticity of the code should you include it as a module: | |
# This can be done by raising an error if a specific line of code is not present. | |
# This will serve as a safeguard and ensure that any malicious code is not executed: | |
raise 'dangerous code' unless code.include?('module ActiveSupport') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment