Need to redirect the non-existence URL's to 404 page instead of parent url
Considering the comments of the previous answer:


Only act on 'node' pages (aliased and not).
Avoid 'page not found' repeating 2 times.


Furthermore removed the unused variable $path.

The code below also avoids a 404 for the path 'node/add'. In case you use the Entity connect module that path might be followed by a dynamic token. The URL could then look like 'node/add/page/entityconnect-form-hmcOTIsupNLNBI-cZ-sSvjsbFISJeOfzT0VBpg0Sbpc'. Obviously that is a path not "known" by Drupal that would otherwise incorrectly result in a 404.

/**
 * Implements hook_init().
 */
function YOURMODULE_init() {
  // Only act on 'node' pages (aliased and not) but not on 'node/add'.
  if (arg(0) === 'node' &amp;&amp; arg(1) !== 'add') {
    // Extract different variables that Drupal utilizes for routing.
    $menu_item = menu_get_item();
    $href = $menu_item['href'];     // node/1
    $current_path = current_path(); // node/1/broken

    // Check if the actual path ($current_path) is different than the Drupal assumption ($href).
    if ($href != $current_path) {
      // Redirect user to 404 page which will handle the HTTP response as well.
      drupal_not_found();
      // Avoid 'page not found' repeating 2 times.
      drupal_exit();
    }
  }
}


UPDATE:
There is now a Drupal 7 module Force 404 that solves just this.