Blacklist certain Ruby on a server? or JSON load instead of Marshal load?

mogwai

1984
Veteran
Joined
Jun 10, 2014
Messages
875
Reaction score
591
First Language
English
Primarily Uses
RMMV
I'm writing an app in PHP that requires seemingly a ruby-only/python-only function, and I've learned how to run rb scripts with PHP so I'm making an online app. I've been testing my app with MAMP and I've only tested basic print/puts on my GoDaddy hosting, but assuming my host doesn't already sandbox the Ruby for me, how do I get rid of functions temporarily during run-time for safety, programmatically?

This is important because the one function I need to use in my app is Marshal.load which evals the Ruby and I intend to allow direct upload of Marshalled rvdata2 files.

I can process the file into my ruby with PHP so I don't any File functions and the write capabilities of File paired with remote/custom eval scares me, so I want to disable the File class most of all.

I tried
Ruby:
File = nil
And that seems to block it, but is that even fully blacklisted during script run?
and what other things should I be scared of?

Side note: The ruby docs seemingly say that JSON load does the same thing as Marshal load, which is safer because it makes an object or something, but I'm getting parse errors with it loading rmvdata2 where as Marshal loads it flawlessly. Perhaps I'm reading the docs on ruby JSON wrong.
DOUBLE EDIT: I'll just quote my original post and edit this, because I've changed my mind. I'm going to make an offline app.

I'm going to use my marshal ruby script pipe with node js, hopefully the same way I used the ruby pipe with php.

I'll just leave this topic open for the discussion about how I was about to put a really bad thing on my server.
 
Last edited:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Frostorm wrote on Featherbrain's profile.
Hey, so what species are your raptors? Any of these?
... so here's my main characters running around inside "Headspace", a place people use as a safe place away from anxious/panic related thinking.
Stream will be live shortly! I will be doing some music tonight! Feel free to drop by!
Made transition effects for going inside or outside using zoom, pixi filter, and a shutter effect
I have gathered enough feedback from a few selected people. But it is still available if you want to sign up https://forums.rpgmakerweb.com/index.php?threads/looking-for-testers-a-closed-tech-demo.130774/

Forum statistics

Threads
105,992
Messages
1,018,189
Members
137,771
Latest member
evoque
Top