Usually, when we ascribe a "due date" - that is when we literally use the words "due date" - we mean that a thing is required on the specified date.
This is simply the meaning of due
expected (to happen, arrive, etc.) at a particular time:
What time is the next train due?
[ + to infinitive ] The meeting is now due to take place next week.
So "due date" would typically mean the date on which something is required or expected.
"Submit a task by X" is not ambiguous. It means submit the task on or before X.
Again, this is simply the meaning of by
not later than; at or before:
She promised to be back by 10 p.m.
I suspect the difficulty, or the ambiguity might actually come from the meaning of the date. Does Friday mean Friday at 9:00am, any time on Friday, one minute before the end of the day on Friday?
But if this level of specificity is included in the "due date" or "due by" there is no ambiguity. "Task X has a due date of 9:00am, 01/01/2019" unambiguously means task X must be completed on or before 01/01/2019 at 9:00am. "Task X must be done by 9:00am, 01/01/2019" has the same meaning.