No video

One Matlab Command You Should Never Use - Why The Eval Command Is Awful [Matlab Rants]

  Рет қаралды 5,712

CodingLikeMad

CodingLikeMad

Күн бұрын

In this video we go over the Eval function in matlab, and discuss what it's for and why it's really insecure. The video is intended for educational purposes only - please be kind to each others code!

Пікірлер: 8
@tejasj1718
@tejasj1718 5 жыл бұрын
Surprisingly good quality for someone with so little subscribers. You earned a new sub!
@CodingLikeMad
@CodingLikeMad 5 жыл бұрын
Thanks so much!
@CoffeeHolic93
@CoffeeHolic93 5 жыл бұрын
Nice stuff. Was wondering why I've been told to steer clear of the Eval function. I no longer wonder that.
@CodingLikeMad
@CodingLikeMad 5 жыл бұрын
Thanks so much! I like your username by the way. The video doesn't cover everything I would want it to, but I thought this was the easiest thing to make the point with. I would say a bigger practical issue is actually that I can't debug eval statements so easily. When you debug code, you go and look at what line of code is crashed on. But with eval, that line of code is in a variable - a variable that might not exist anymore if it is running a live system. The line of code could also be very complicated, depending on how the eval is being used. The security stuff though I think illustrates why this command is fundamentally broken. Glad you enjoyed :)
@CoffeeHolic93
@CoffeeHolic93 5 жыл бұрын
@@CodingLikeMad Yeah that makes sense. All scripts and functions that I've made have been on the shorter side as I'm a biologist (At least once I turn in my thesis I am, hah) and I am "just" using matlab to automate data analysis, and since my scripts are never long they're generally easy to debug. :)
@rafaelbogoportalchagas824
@rafaelbogoportalchagas824 4 жыл бұрын
Great video! Learned a lot
@lmmartinez97
@lmmartinez97 3 жыл бұрын
I use it to evaluate symbolic expressions and obtain real values. Is there any other alternative? Pretty scary stuff if you ask me
@CodingLikeMad
@CodingLikeMad 3 жыл бұрын
This is almost exactly the case I am most worried about actually. User context matters a lot here. If you are using a web interface to supply those strings to be evaluated, that's a big risk. If it's just you, or just a small group of trusted coworkers, that's less concerning. If the feature is required, you cant find an alternative method, and the audience potentially includes a malicious actor, I would treat this the same way I would an sql enabled web server. This includes first and foremost cleaning the inputs of all symbols that are potentially malicious. Because () are on that list, you have a pretty big problem though. I would then consider layered security, making sure the matlab instance does not have privileges on the machine it should not have, making sure that sensitive data is not available on the machine if possible, and potentially encapsulating it in a virtual machine. I can't give great advise here though, I'm very much not an expert in this type of thing, and if I had a good solution I would have offered it. You will need to do your own research on this one, I am unable to provide a good solution via comment here because it is such a hard problem.
Why Eval And Exec Are The WORST Python Functions [Tech Rants]
22:16
CodingLikeMad
Рет қаралды 1,9 М.
Anonymous Function Handles In Matlab - Advanced Matlab Tutorial
11:15
Matching Picture Challenge with Alfredo Larin's family! 👍
00:37
BigSchool
Рет қаралды 47 МЛН
Or is Harriet Quinn good? #cosplay#joker #Harriet Quinn
00:20
佐助与鸣人
Рет қаралды 10 МЛН
拉了好大一坨#斗罗大陆#唐三小舞#小丑
00:11
超凡蜘蛛
Рет қаралды 14 МЛН
Indexing Columns and Rows | Managing Code in MATLAB
3:46
MATLAB
Рет қаралды 38 М.
If __name__ == "__main__" for Python Developers
8:47
Python Simplified
Рет қаралды 398 М.
MATLAB - 03 - Function Evaluation
24:29
Masood Ejaz
Рет қаралды 4,4 М.
Simulink Masks
7:44
Simulink Instructor
Рет қаралды 2,7 М.
Symbolic Substitution
3:24
SnugglyHappyMathTime
Рет қаралды 28 М.
The BEEFY mini PC - Minisforum AtomMan G7 PT
12:40
ShortCircuit
Рет қаралды 183 М.
Matching Picture Challenge with Alfredo Larin's family! 👍
00:37
BigSchool
Рет қаралды 47 МЛН