HarbourMasters / HarbourMasters/Shipwright
please add strong overflow detection on model parser for mods made by users
- Dominant language
- C
- Stars
- 5.4k
- Forks
- 837
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 72
Description
this not only enhances security for the average user. but also comes in really handy for debugging broken models and ensures that files summited by users are safely read without the worry of an attacker trying to exploit the binary.
=======
considerations:
carefully read data from the modfile
ie. if our header looks like this
`typedef model {
int num_vertices;
vertix data[];
//etc....
} my_model`
you can easily say something like
`if (num_vertices != data.length) //the file is compromised
or
if ( num_vertices > REALLY_LONG_NUMBER) //file is probably corrupt or compromised
`
so what im mainly trying to say is understand eventually somebody is going to try to do this
`NUM_VERTICES = 9999999999999999;
for (int i = 0; i < NUM_VERTICES; i++)
process_vertex();
`
compile using ASLR
possible to validate stack integrity using _stack_chk_
check for data corruption
it can be easy to detect assembly code through a custom program and raise red flags if the data appears to be encrypted
and lastly a told that can rebuild parse models. I **highly recommend javascript as a web utility for this since chrome runs sandboxed and it's theoretically impossible to bypass such security.**
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.