pavel
And anyway much software has memory leaks
布丁
Infosec 101 must cover this
\Device\NUL
Did you using smart pointers ?
pavel
In modern c++ this problem is not such big
\Device\NUL
Not allocating memory at all is the best way to avoid memory leak
Anonymous
pavel
Smart pointers and safe functions replacement solve this alot
布丁
While introducing a little runtime overhead
Hussein
like the V8 engine few weeks ago has a severe binary vulnerbility caused ACE
Hussein
布丁
Good news is V8 sandboxes everything?
Hussein
yeah and they bypassed that
布丁
Even vulnerabilities wouldn’t damage too much
Hussein
binary vulnerbilities are the worst
because the V8 engine and almost all other js engines doesn’t ask the operating system to sandbox it
so a buffer overflow can cause catasrophic results
Hussein
it implement the sandbox itself as a program
so if an ACE occurs it can bypass that easily and load malware on the victim’s machine
pavel
It is
布丁
vuln in V8 and sandbox bypassing are two different things
Anonymous
I’m working with my friend on a simple HTTP server that returns plain text and also has two parsers for request/response bodies. He told me pay how much you like and I’m a good friend. So how much should I pay him?
The source-code is awesome and we’ve worked on it about a week.
布丁
One can expect such a huge C++ program like V8 has a ton of vulnerabilities
布丁
That’s the point of sandboxing
pavel
Anonymous
Zero
Time & Skills are valuable. I can’t pay nothing..
pavel
If it a pet project and not professional
Hussein
One can expect such a huge C++ program like V8 has a ton of vulnerabilities
the V8 has to implement a way for javascript code to run without giving it any permission
so there tons of stuff can go wrong. basically if any part of the program fails to allocate memory for itself NOT for the generated code the you will escape the sandbox automatically because you are writing into the V8 program’s memory
unless this get sandboxed (chroot) by the operating system this is catastrophic if exploited
Pavel
Hussein
That’s the point of sandboxing
that’s for the compiled javascript not the V8 engine itself
otherwise it would be impractical and will slow the program a lot
Anonymous
Hussein
布丁
布丁
Btw isn’t the whole Chromium browser process isolated in a sandbox?
Kanni
Hello guys!
I have this C code to print the first 98 Fibonacci numbers. It runs, but the last few numbers have a + or - 1 or 2 difference from the correct numbers I found online.
.
.
#include <stdio.h>
/**
* main - finds and prints the first 98 Fibonacci numbers
*
* Return: Always 0
*/
int main(void)
{
int i;
long double fibonacci;
long double fib1 = 1;
long double fib2 = 2;
printf("%.0Lf, ", fib1);
printf("%.0Lf, ", fib2);
for (i = 3; i <= 98; i++)
{
fibonacci = fib1 + fib2;
fib1 = fib2;
fib2 = fibonacci;
if (i == 98)
printf("%.0Lf\n", fibonacci);
else
printf("%.0Lf, ", fibonacci);
}
return (0);
}
I also tried adding the 1 to the numbers that vary from the original, but the output wasn't any different from the one I got before
Kanni
klimi
I think this is because using double which just doesn't have enough precision for you
Kanni
Hussein
Btw isn’t the whole Chromium browser process isolated in a sandbox?
look.. there is nothing such real sandbox for programs
it is just a way for programs to execute other programs in an isolated way
the chromium browser is divided into a rendering engine for html and css and a javascript engine and a network engine
each engine try to isolate itself from the others
when you divide (fork) your program into processes you will only separate your process from other process so exploiting one of them will cause your computer to be affected but won’t effect other functionalities of your program but will infact infect your computer
Hussein
klimi
Hussein
not to the nearest power of 10 like we do
pavel
布丁
pavel
And don't compare float/double with exact value. You can compare exact only with 0 +-1 nan inf
布丁
I don’t believe people call it a “sandbox” just because it runs in a separate process
pavel
Kanni
Kanni
Hussein
布丁
It is
Doesn’t make sense to me😭 when you pass in a "--no-sandbox" then the multi-process architecture becomes single-process? Cannot be, right
Hussein
You are right they use a chroot and they protect the kernel (or at least trying to)... my bad
but they seem to exploit the validator itself
Hussein
unfortunately they haven’t disclose any detaila about it except that it was a binary exploitation
Hussein
pavel
\Device\NUL
Hussein
uint64_t
yeah he can do that too 😅
Kanni
Kanni
Kanni
\Device\NUL
The numbers are too big so they got overflowed
Kanni
klimi
Please, read the rules, Thank you :)
Sir
Hussein
Alex
hi guys, how can i use the signal alarm() multiple times?
void handler(int signum)
{
do something
}
void main()
{
code
signal(SIGALRM, handler)
while (1)
{
alarm (5)
code
}
}
in this way it will work?
Alex
i have a main thread that has to accept multiple connections and periodically has to check those connections
Anonymous
Alex
bro my code has more than 1000 lines of codes
Hussein
Alex
oh ok
klimi
Alex
yeah, i want only the main thread to have the SIGALRM, so the others will have a SIG_IGN
Alex
klimi
klimi
so it will be doing code all the time, and the alarm won't be executed if the code takes less that 5 seconds