Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6330149
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T17:49:02+00:00 2026-05-24T17:49:02+00:00

i have portions of my program that require administrative access (settings that affect all

  • 0

i have portions of my program that require administrative access (settings that affect all users, stored in HKLM, and are limited to administrative access).

i’ve changed my software to indicate that elevation is required:

enter image description here

In response i am going to launch my executable while prompting for elevation:

SHELLEXECUTEINFO shExecInfo;
shExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
shExecInfo.fMask = NULL;
shExecInfo.hwnd = NULL;
shExecInfo.lpVerb = L"runas";
shExecInfo.lpFile = L"myapp.exe";
shExecInfo.lpParameters = NULL;
shExecInfo.lpDirectory = NULL;
shExecInfo.nShow = SW_MAXIMIZE;
shExecInfo.hInstApp = NULL;
ShellExecuteEx(&shExecInfo);

What i was going to do is pass the name of a named pipe on the command line, telling myself where it can connect back to in order to get instructions on what it’s supposed to be doing:

myapp.exe /uac 6C844671-E262-46DD-939E-47517F105FB6

(Yes, using a GUID as the name of the pipe).

Through this pipe i would tell my elevated clone what database, e.g.:

  • what server database it’s supposed to be connecting to
  • the user it should say it making the changes
  • the thing it should add/edit/delete

My concern was then that anyone could launch myapp.exe, and then feed it all kinds of requests – things i don’t want it to do cause i didn’t launch it, e.g.:

MaliciousProgram.exe:

 ShellExecute("myapp.exe /uac HahaYouDoWhatISayNow")

i remember during the Longhorn beta there was a Channel9 video, or an article, talking about UAC and the dangers of the wrong of doing IPC (Inter-process communication).

i don’t want to re-invent the wheel, making security mistakes that have already been solved. But i cannot find any existing guidance on the “correct” way to do IPC with UAC elevation.

What’t he accepted pattern for doing IPC to communicate with spawned elevated process for temporary elevated actions?


Edit: Combined followers of uac and ipc tags: 53

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T17:49:03+00:00Added an answer on May 24, 2026 at 5:49 pm

    I don’t believe there is a security issue here (with certain caveats as noted below). If the user can’t elevate, this solution won’t work anyway; if the user can elevate, and is malicious, the machine is already compromised. For example, if a malicious user wants to make changes in HKLM, why use myapp.exe when regedit is available?

    However, I’m confused by your mention of a server database; how does this fit in with the requirement for elevation? Generally speaking elevation is not required for accessing remote resources. (If either myapp.exe or HKLM contains a password to the server database, it shouldn’t.)

    As for the choice of IPC: I’m not expert in UAC programming, but searching MSDN I’ve noticed that elevated COM objects are mentioned several times, e.g.:

    http://msdn.microsoft.com/en-us/magazine/cc163486.aspx

    see also the powerpoint slides at the fifth link in this article:

    http://msdn.microsoft.com/en-us/library/bb756996.aspx

    However, if you’re not happy with COM (join the club!) then using a named pipe as you suggest should be just as effective. You do however need to take the usual precautions necessary for named pipes – make sure that you create the server end of the named pipe before launching the elevated process, that you check whether the pipe already existed, and that you create it with an appropriate ACL.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two Rails 3 applications that will share portions of the same database
I have a Python program that processes fairly large NumPy arrays (in the hundreds
I have a program that embeds Lua and implements a form of lazy function
I have a program that is saves information like a list of names, file
I have a portion of code that takes the text of a TextField (there
The problem: we have one application that has a portion which is used by
I'm working on a program for class that involves solving the Chinese Postman problem
I am writing a program that takes letters and converts them to telephone numbers.
I have a batch script that eventually starts another batch file and waits for
I wrote a little Python program that looks though a directory (and its subdirectories)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.