Демонстрация уязвимостей printf или __android_log_print с Android NDK

Вот взломать с помощью pointer-events с hover:

<!doctype html>
<html>
	<head>
		<title></title>
		<style>
/* accessory */
.parent {
	width: 200px;
	height: 200px;
	background: gray;
}
.parent, 
.selector {
	display: flex;
	justify-content: center;
	align-items: center;
}
.selector {
	cursor: pointer;
	background: silver;
	width: 50%;
	height: 50%;
}
		</style>
		<style>
/* pertinent */
.parent {
	background: gray;
	pointer-events: none;
}
.parent:hover {
	background: fuchsia;
}
.parent 
.selector {
	pointer-events: auto;
}
		</style>
	</head>
	<body>
		<div class="parent">
			<div class="selector"></div>
		</div>
	</body>
</html>

0
задан sam_c 28 March 2019 в 04:51
поделиться

1 ответ

Вы понимаете, что Android с открытым исходным кодом.

Начнем с поиска __android_log_print() и поиска его: https://android.googlesource.com/platform/system/core/+/refs/heads/master/liblog/logger_write.cpp [ 117]

int __android_log_print(int prio, const char* tag, const char* fmt, ...) {
  va_list ap;
  char buf[LOG_BUF_SIZE];
  va_start(ap, fmt);
  vsnprintf(buf, LOG_BUF_SIZE, fmt, ap);
  va_end(ap);
  return __android_log_write(prio, tag, buf);
}

В конечном итоге я посмотрел: https://android.googlesource.com/platform/bionic/+/refs/heads/master/libc/stdio/vfprintf.cpp

строки 453-454:

  case 'n':
    __fortify_fatal("%%n not allowed on Android");

В коде также упоминается дополнительная безопасность через FORTIFY, которая описана в следующем сообщении в блоге:

https: //android-developers.googleblog.com/2017/04/fortify-in-android.html

0
ответ дан Morrison Chang 28 March 2019 в 04:51
поделиться
Другие вопросы по тегам:

Похожие вопросы: