Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by Ijatsu · Dec 15, 2014 at 08:42 AM · networkingserverauthoritative

Authoritative server security?

I am trying to build a networking game with an authoritative server.

The problem is currently, I don't see how you could avoid client from instantiating object and calling RPCs. So any client can basically screw up the server and the other clients without any restriction.

Is there a solution? Is it normal that we have nothing to avoid this while all communications are supposed to pass by the server anyway?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by 03gramat · Jan 15, 2015 at 02:13 PM

Heres a great tutorial on crating a basic authoritative server:

https://www.youtube.com/watch?v=QfzrpxO89tU

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by bugmagnet · Jan 15, 2015 at 04:19 PM

The solution is simple:

In the RPC check whether you are the server or the client. In calls where it is only the server who should be allowed to operate, simply return if the code is running on the client:

 [RPC]
 public void myServerOnlyMethod()
 {
 
   if (isServer())
   {
              //do a server only thing
   }
 
 }

 [RPC]
 public void myClientOnlyMethod()
 {
 
   if (isClient())
   {
              //do a client only thing
   }
 
 }




Comment
Add comment · Show 4 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Ijatsu · Jan 18, 2015 at 11:39 PM 0
Share

Hello and thanks for taking time to answer.

I think you do not understand the security issue and you're being off topic, the problem is not to distinguish if you're the server or the client, nor avoiding the client from executing server side RPCs. Currently nothing prevents a malicious client from creating and destroying network objects, or from impersonating the server by calling client side RPCs. I'm also convinced that if you go deeper in the protocol designs you can see that you can do pretty much what you want on other clients and server as a client.

Remember this key phrase in security: never trust user's input.

avatar image bugmagnet · Jan 18, 2015 at 11:54 PM 0
Share

Well, my comment is assu$$anonymous$$g that you don't use any of the fancy auto-gameobject features that unity gives you. They are all poison imo. Just do straight up old school RPC's and data strea$$anonymous$$g and you will have total control.

avatar image Ijatsu · Jan 19, 2015 at 01:16 AM 0
Share

You don't use, but that doesn't mean a malicious client won't use them. AFAI$$anonymous$$ I've not seen any flag to disable those features. But yes I agree with you, they're poison.

avatar image bugmagnet · Jan 19, 2015 at 09:57 PM 0
Share

Well, I think there's at least 2 ways to keep that from happening:

1) they can't use them if they can't connect. If you put some kind of connection auth process it would be quite difficult to replicate it except for experts.

2) even if the attacker is able to instantiate something on the server, that 'thing' would be perfectly useless if you apply my original suggestion, or even something like: if (!networkView.is$$anonymous$$ine) Destroy(this);

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

28 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Unity networking tutorial? 6 Answers

Authoritative server strategy 0 Answers

Authoritative vs Non-authoritative server (turn-based) 0 Answers

Can a person be both a client and a server? (and more) 0 Answers

ontriggerenter will not work with !islocalplayyer 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges