Sunday, October 21, 2012

Security and Objects

Mobile code is one of the great challenges for software security. Lets say  you are writing an email application. The idea that people could send little apps to each other in email messages might seem like a potentially interesting feature: users could build polls, schedule meetings, play games, share interactive documents. Kind of cool.

And if the platform you are building upon supports reflectively evaluating code, it could be as easy as something like this (in OO pseudocode):

    define load_message(message)
        ...
        eval(message.code)

Of course it can't be that easy. What if the code in the message does something like:

    new stdlib.io.File("/").delete()

The standard way to avoid the vulnerability is to put the code in a so-called sandbox. It sounds very secure, but in practice this usually amounts to gathering up a list of "dangerous" call sites and inserting in each some code to check if the caller has permission to proceed. So the implementation of delete would include code along the lines of:

    define delete()
        if VM.callStackContainsEvilCode?()
            raise YouShallNotPassException()

        ...

This is fraught with problems. It requires runtime support for inspecting the call stack and a system for declaring that certain code has some level of authorization while some other code has a lower level. Not to mention the busywork of going trough the code and peppering that little snippet over every suspect call site. If you miss one — say, for instance, a method that gets the addresses of all contacts on your email application — and you have a security bug on your hands.

A better way ?

Perhaps there is a better way. Take another look at the offending line: new stdlib.io.File("/").delete(). It is only able to call the dangerous delete() method because it has a reference to a file object pointing to the root of the filesystem. And it only has that reference because it could reach for the File class on a global namespace. What if there was no global namespace?

It might seem weird, but it's not that hard to imagine a programming system lacking a global namespace. Many object-oriented languages, following Smalltalk's lead, have a notion of a metaclass, an object that represents a class. Many of them (also following Smalltak) also get by without a "new" operator. Objects are created by calling a method — usually named new() — on the metaclass object.

We are very close now. The last step, unfortunately not taken by most common languages, is to avoid anchoring the metaclass object onto a global namespace. The result is that code can only create objects of the classes it holds a reference to. And it only has a reference if it is given one via a method or constructor parameter.

Proceeding recursively, we end up with a stratified program. There is an entry point that receives a reference to the entire standard library, and each call site decides how much authority to grant each callee. On our example, when we evaluate external code we can grant very little authority, meaning we can pass the evaluated code just a handful of references. Care must be taken so that none of them will direct or indirectly provide a way to create a File. In a way, object design becomes security policy.

And we get very fine-grained control over such policy. We could, for instance, grant loaded code authority to write on a designated directory just by passing it a reference to the Directory object for that directory. Our choices get even more interesting when we realize we can pass references to proxies instead of real objects in order to attenuate authority. Continuing with our example, hoping it doesn't get too contrived, we could build a proxy for the Directory that checks if callers exceed a given quota of disk space.

Research

I have mentioned above that most common languages don't fit this post's description. But there are languages that do, a prime example is E. In fact, there is a whole area of research for dealing with security in this manner, it's called "object capability security".

I'm not really a security guy, I got interested in the area due to the implications for language and system design. If you got interested, for any reason, please check out Mark Miller's work. He is the creator of the E language and the javascript-based Caja project. His thesis is very readable.

242 comments:

«Oldest   ‹Older   201 – 242 of 242
James Ian said...

I’m amazed by your art of writing . You’re a fresh DNP candidate. At this time, it’s too early to start worrying about your DNP capstone project. Possibly, the idea of working with a quality DNP capstone project writing service hasn’t crossed your mind. You still have time, don’t you? But time keeps playing tricks on people. At the start, it may feel like you’ve got more than enough time. Time flies, though. Before you know it, you’ve run out of all of the time. Read more about DNP Capstone Project Writers

saira said...

Students who have issues with their paper can rapidly associate with the right Paper help online service so you can get the suitable paper help.

Arif said...

This must be a popular blog. The content and knowledge shared here is of high quality. Gas and electric tankless water heaters run more efficiently than the conventional water heaters of the same fuel type. We rated the annual energy consumption cost Excellent for a gas model but only Fair for an electric, but both rate Very Good for energy efficiency. Read more on Tankless Water Heater Reviews

Tech Institute said...

I am overwhelmed by your article with excellent topic and valuable information thanks for sharing.
Data Science Course in Bangalore

Cleaningservice121 said...

Thanks for Sharing This Article. It is very so much valuable content. I hope these Commenting lists will help to my website
Website :- Microwave repair service

saira said...

Students who have issues with their paper can rapidly associate with the right Paper help online service so you can get the suitable paper help.

Devi said...

Really well-written article. Thanks for sharing this article, I appreciate this article.
usage of python
highest paid programming language
why should i learn python
hadoop learning path
java interview questions and answers

zack said...

I value your difficult work. Continue posting new updates with us. This is actually a magnificent post. Decent Blog Very fascinating and helpful data on your site. A debt of gratitude is in order for sharing the blog and this extraordinary data which is certainly going to support us.

difference between office 2019 vs office 365

Ethical Hacking Course said...

Top-quality blog with unique content and information shared was valuable looking forward to the next updated thank you.
Ethical Hacking Course in Bangalore

QuickBooks Help said...

QuickBooks has been one of the preferred software for accounting management, payroll functions, tax filing, bookkeeping, etc. At the same time, it is also prone to issues such as quickbooks error 6209 which can occur while installing or updating the QuickBooks application. Several consequences are there of this error like the abrupt shutdown of the application, or QB software not working at all, etc. If you are also stuck with this problem, you will have to repair the QuickBooks or reinstall it from the root. Other troubleshooting includes repairing the .net framework or using the QB diagnostic tool. Often it becomes a trap while eliminating the error 6209, resulting in a huge waste of time. You can save yours by contacting the QB support number and taking help from experts. Let talk.

Unknown said...

If you are thinking, “Who can help me do my assignment within the deadline?” then, you have come to the right place. We make sure that you do not lose marks for a late submission. We have the best assignment experts who will accurately format the paper following specifically your college’s or university’s guideline. Besides this, we will also scan the document in advanced software to ensure there is no sign of plagiarism in any section.

annewilliam said...

Lovely post thanks for sharing. Read mine also:
Mozilla Firefox Support Number
Mozilla Firefox Technical Support Phone Number

arti kirar said...

Thanks for sharing such a nice thinking, post is pleasant, thats why i have read it completely
Website: cz jewellery

Euni said...

I have bookmarked your site for more articles like this and tell you what? Do you need a Water Softener ? Did you know that your water is “hard” if it contains at least 60mg of dissolved calcium and magnesium? In some areas, this number can go as high as 180mg. Defeating the hardness of water is not such a tough challenge but the rewards of it are great. Get

Trending Technologies said...

Fantastic article and excellent topic with valuable information thanks for sharing.
Data Science Course in Bangalore

agent123 said...

it is really a great and helpful piece of info. I am glad that you shared this helpful information with us. Please keep us informed like this. Thank you for sharing.
malaysia visa

Business Analytics Course said...

Actually I read it yesterday but I had some ideas about it and today I wanted to read it again because it is so well written.

Business Analytics Course

jenifer027 said...

MyAssignmentHelpNow provides assignment help service to the students of Australia...We are well known and most demanding writing service provider over there. If you are looking for the best writing service provider over there, then we are the one-stop-shop for you.

Assignment Help

Priyanka said...

Attend The Data Analyst Course From ExcelR. Practical Data Analyst Course Sessions With Assured Placement Support From Experienced Faculty. ExcelR Offers The Data Analyst Course.
Data Analyst Course

david anderson said...

A student's life is a bustling issue with broad learning plans, social life, and extra-curricular responsibilities, and for a few; even part-time work. Offer your assignment stresses with us like a huge number of your companions have, from around the globe. We won't frustrate you. In our undertaking to offering the best Assignment Help online in Canada

Unknown said...

Get in touch with the best History essay help service of the UK. Avail professional assistance. The good news is it’s not as difficult as you think for the essay writers. The efficiency of our finance essay help services will ensure your academic grades never take a nosedive.

Huongkv said...

Đại lý vé máy bay Aivivu, tham khảo

vé máy bay đi Mỹ

vé máy bay tết 2021

giá vé máy bay eva đi canada

vé máy bay đi Pháp giá rẻ

vé máy bay đi Anh bao nhiêu

săn vé máy bay 0 đồng

combo đà nẵng 4 ngày 3 đêm 2021

combo vinpearl nha trang 2021

visa đi trung quốc cần những gì

dịch vụ cách ly khách sạn trọn gói

Ankit Ron said...

Download app to know more.Play and win exclusive prizes & experiences, only with Fantasy Power 11 .Fantasy Power 11- fantasy cricket best app.cricket game download

makeup artist said...

BHI Makeup Academy is the best Makeup Academy in Mumbai where you learn Makeup & hair styling courses from Industry Experts from Bollywood, Hollywood & International Makeup Industry. Give wings to your dreams and make them come true and more beautiful than ever! Learn the best techniques and best practices from our Ace designer team from the international arena to give that perfect shine to your talent while learning any makeup artist course in mumbai. Become a prominent hair & makeup artist and enrich the obscured star within you to reach great heights!

DataScience Specialist said...

I have to search sites with relevant information ,This is a
wonderful blog,These type of blog keeps the users interest in
the website, i am impressed. thank you.
Data Science Training in Bangalore

assignment help said...

These days, students are facing lots of issues in writing assignments and essays because they are busy in their other activities like part-time jobs, or day to day activities. Here, we take the place. We offer our aspirants a mind-boggling solution and deliver a top-notch assignment to them. We follow adequate learning by undertaking an approach to update our professionals with new ideas and strategies. We can deliver your assignment on time by adhering to the guidelines of the project. So, if you need a dependable assignment help expert, let’s get in touch with us right now.

Assignment Helper said...

We give online Homework Help covering all the topics. Our experts provide a great help to a student in dominating their college assignments, but likewise in the professional way. The ability of our qualified Homework Helper could help students in getting redone assignments according to their requirements.

assignmentauthors said...

It was invented by a John Stith Pemberton in 1892 in Columbia, Georgia. Despite competition from other soft drink companies like Pepsi, assignment help

Parmkhuab said...

Nice post ! I love its your site after reading ! thanks for sharing.
bewafa shayari
best shayari on life
dard bhari shayari video

Businessassignmenthelp said...

business assignment help

statanalytica said...

Calculus Assignment Help

codeavail said...

computer science assignment help

DataScience Specialist said...

I have to search sites with relevant information ,This is a
wonderful blog,These type of blog keeps the users interest in
the website, i am impressed. thank you.
Data Science Training in Bangalore

Calltutors Australia said...

Our online assignment help Australia service is an online assignment help service provided by experienced Australian assignment help expert at here.
University Of New England Homework Help
University Of Queensland Assignment Help
University Of New South Wales Assignment Help
University Of Melbourne Assignment Help
Griffith University Assignment Help
La Trobe University Homework Help
Southern Cross University Homework Help

Java Assignment Help said...

Java Assignment Help

buycollegeessay said...

Essay Writing Help

Housethat said...

If you want to buy your own dream home without any brokage book now with us and get exclusive offer.
Luxury Apartment in Noida
Book Your Luxury Home.

https://ljmedia.org/ said...

Twitter Promotion is a great way to have this blog seen but if you have videos you can also buy tiktok views and more !

Courses Training said...

Actually I read it yesterday but I had some ideas about it and today I wanted to read it again because it is so well written.
Data Science Course in Vadodara

https://socialexperience.org/ said...

YouTube Promotion seems a great way to have your videos seen but you can also buy slow instagram likes as well for your photos to receive daily traffic.

ve may bay tet said...

Mua vé máy bay tại Aivivu, tham khảo

Ve may bay di My

thông tin chuyến bay từ mỹ về việt nam

mua vé máy bay từ anh về việt nam

ve may bay tu phap ve viet nam

Nnedaa said...

Hello, I’m Neda. I’m a web developer living in Pakistan. I am a fan of photography, design, and fitness. I’m also interested in web development and arts. You can read my blog with a click Urdu Poetry

«Oldest ‹Older   201 – 242 of 242   Newer› Newest»