alpine 3.7
misc weakness #429

4

Weakness Breakdown


Definition:

The software specifies permissions for a security-critical resource in a way that allows the resource to be read or modified by unintended actors.

Warning code(s):

It's often easy to fool getlogin. Sometimes it does not work at all, because some program messed up the utmp file. Often, it gives only the first 8 characters of the login name. The user currently logged in on the controlling tty of our program need not be the user who started it. Avoid getlogin.

File Name:

perl/src/perl-5.26.3/win32/wince.h

Context:

The highlighted line of code below is the trigger point of this particular Alpine 3.7 misc weakness.

 XCE_EXPORT char *xcestrlwr(char *string);
#define strupr xcestrupr
#define strlwr xcestrlwr

XCE_EXPORT double xcestrtod(const char *s, char **errorptr);
XCE_EXPORT long xcestrtol(const char *s, char **errorptr, int base);
XCE_EXPORT unsigned long xcestrtoul(const char *s, char **errorptr, int base);
#define strtod xcestrtod
#define strtol xcestrtol
#define strtoul xcestrtoul

XCE_EXPORT int xcestrnicmp(const char *first, const char *last, size_t count);
#define strnicmp xcestrnicmp

XCE_EXPORT int xceumask(int mask);
#define umask xceumask

XCE_EXPORT int xceisatty(int fd);
#define isatty xceisatty

XCE_EXPORT int xcechsize(int fd, unsigned long size);
#define chsize xcechsize

XCE_EXPORT char *xcegetlogin();
#define getlogin xcegetlogin

XCE_EXPORT DWORD XCEAPI XCEGetModuleFileNameA(HMODULE hModule, LPTSTR lpName, DWORD nSize);
XCE_EXPORT HMODULE XCEAPI XCEGetModuleHandleA(const char *lpName);
XCE_EXPORT FARPROC XCEAPI XCEGetProcAddressA(HMODULE hMod, const char *name);

/* //////////////////////////////////////////////////////////////////// */

#define getgid  xcegetgid
#define getegid xcegetegid
#define geteuid xcegeteuid
#define setgid  xcesetgid

#define strupr  xcestrupr
#define time    xcetime

XCE_EXPORT BOOL XCEFreeEnvironmentStrings(LPCSTR buf);
#define GetEnvironmentStrings XCEGetEnvironmentStrings
#define FreeEnvironmentStrings XCEFreeEnvironmentStrings

void wce_hitreturn();

END_EXTERN_C

#endif 

The registered trademark Linux® is used pursuant to a sublicense from the Linux Foundation, the exclusive licensee of Linus Torvalds, owner of the mark on a world­wide basis.